Skip to content

Commit

Permalink
[Fixes #12124] GNIP 100: Assets - improve model
Browse files Browse the repository at this point in the history
  • Loading branch information
etj committed May 6, 2024
1 parent 1ec7613 commit 9d1697b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
3 changes: 1 addition & 2 deletions geonode/assets/migrations/0001_initial.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone


Expand All @@ -23,7 +22,7 @@ class Migration(migrations.Migration):
("title", models.CharField(max_length=255)),
("description", models.TextField(blank=True, null=True)),
("type", models.CharField(max_length=255)),
("created", models.DateTimeField(default=django.utils.timezone.now)),
("created", models.DateTimeField(auto_now_add=True)),
("owner", models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
(
"polymorphic_ctype",
Expand Down
3 changes: 1 addition & 2 deletions geonode/assets/models.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from django.db import models
from django.utils.timezone import now
from polymorphic.managers import PolymorphicManager
from polymorphic.models import PolymorphicModel
from django.db.models import signals
Expand All @@ -15,7 +14,7 @@ class Asset(PolymorphicModel):
description = models.TextField(null=True, blank=True)
type = models.CharField(max_length=255, null=False, blank=False)
owner = models.ForeignKey(get_user_model(), null=False, blank=False, on_delete=models.CASCADE)
created = models.DateTimeField(default=now)
created = models.DateTimeField(auto_now_add=True)

objects = PolymorphicManager()

Expand Down

0 comments on commit 9d1697b

Please sign in to comment.