Skip to content

Commit

Permalink
fix: EditorialBoardLockUser creation date
Browse files Browse the repository at this point in the history
  • Loading branch information
francesco-filicetti committed May 8, 2024
1 parent 6cddd67 commit 5bf3552
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 1 deletion.
Binary file added example/media/medias/2024/eventi.webp
Binary file not shown.
21 changes: 21 additions & 0 deletions src/cms/contexts/migrations/0018_editorialboardlockuser_created.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Generated by Django 4.2.9 on 2024-05-08 12:15

from django.db import migrations, models
import django.utils.timezone


class Migration(migrations.Migration):
dependencies = [
("cmscontexts", "0017_webpath_access"),
]

operations = [
migrations.AddField(
model_name="editorialboardlockuser",
name="created",
field=models.DateTimeField(
auto_now_add=True, default=django.utils.timezone.now
),
preserve_default=False,
),
]
1 change: 1 addition & 0 deletions src/cms/contexts/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,7 @@ def __str__(self): # pragma: no cover
class EditorialBoardLockUser(models.Model):
lock = models.ForeignKey(EditorialBoardLock, on_delete=models.CASCADE)
user = models.ForeignKey(get_user_model(), on_delete=models.CASCADE)
created = models.DateTimeField(auto_now_add=True)

class Meta:
verbose_name_plural = _("Editorial Board Locks Owners")
Expand Down
2 changes: 1 addition & 1 deletion src/cms/contexts/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
class EditorialBoardLockSerializer(serializers.ModelSerializer):
class Meta:
model = EditorialBoardLock
fields = '__all__'
fields = ['pk', 'object_id', 'content_type']


class EditorialBoardLockUserSerializer(serializers.ModelSerializer):
Expand Down

0 comments on commit 5bf3552

Please sign in to comment.