From 31a9231e7f38553c086784294ccbe4a0a3992279 Mon Sep 17 00:00:00 2001 From: lxf Date: Wed, 23 Dec 2020 10:41:23 -0500 Subject: updated normalize to store the type of post where applicable --- app/posts/models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/posts/models.py') diff --git a/app/posts/models.py b/app/posts/models.py index 302d278..857b619 100644 --- a/app/posts/models.py +++ b/app/posts/models.py @@ -245,7 +245,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, pub_date=instance.pub_date, title=instance.title, 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_type=instance.get_post_type_display()) post_save.disconnect(post_save_events, sender=Post) instance.save() post_save.connect(post_save_events, sender=Post) -- cgit v1.2.3-70-g09d2