diff options
author | luxagraf <sng@luxagraf.net> | 2020-04-07 09:54:04 -0400 |
---|---|---|
committer | luxagraf <sng@luxagraf.net> | 2020-04-07 09:54:04 -0400 |
commit | 426dd7545dbe74c405aed922169ba1d2e9df0892 (patch) | |
tree | a14aff0d571c9262e54d0064e08801b1b8a7432a /app/posts | |
parent | 0fdb50984668da4f360a0408ba50cb43136d3de9 (diff) |
fixed a bug in how posts save themselves as relatedposts
Diffstat (limited to 'app/posts')
-rw-r--r-- | app/posts/models.py | 4 |
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) |