diff options
Diffstat (limited to 'app')
-rw-r--r-- | app/jrnl/models.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/app/jrnl/models.py b/app/jrnl/models.py index f3734da..a1ab9a7 100644 --- a/app/jrnl/models.py +++ b/app/jrnl/models.py @@ -278,9 +278,9 @@ def post_save_events(sender, update_fields, created, instance, **kwargs): """ Creates a generic related entry when a new post is added """ - if created: + if created or 'title' in update_fields or 'slug' in update_fields: related, c = RelatedPost.objects.get_or_create(model_name=instance.get_content_type(), entry_id = instance.id, pub_date=instance.pubdate) - if c: + if not c: related.title = instance.title related.slug = instance.slug related.save() |