summaryrefslogtreecommitdiff
path: root/app/posts
diff options
context:
space:
mode:
Diffstat (limited to 'app/posts')
-rw-r--r--app/posts/models.py4
1 files changed, 1 insertions, 3 deletions
diff --git a/app/posts/models.py b/app/posts/models.py
index 0c5d74f..d4000d9 100644
--- a/app/posts/models.py
+++ b/app/posts/models.py
@@ -193,9 +193,7 @@ def cache_gravatar(sender, comment, **kwargs):
@receiver(post_save, sender=Post)
def post_save_events(sender, update_fields, created, instance, **kwargs):
- related, created = RelatedPost.objects.get_or_create(model_name=instance.get_content_type(), entry_id = instance.id)
- related.title = instance.title
- related.slug = instance.slug
+ related, created = RelatedPost.objects.get_or_create(model_name=instance.get_content_type(), entry_id = instance.id, pub_date=instance.pub_date, title=instance.title, slug=instance.slug)
post_save.disconnect(post_save_events, sender=Post)
instance.save()
post_save.connect(post_save_events, sender=Post)