diff options
Diffstat (limited to 'app/syndication/models.py')
-rw-r--r-- | app/syndication/models.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/app/syndication/models.py b/app/syndication/models.py index 53a6ed1..7ddb941 100644 --- a/app/syndication/models.py +++ b/app/syndication/models.py @@ -24,7 +24,7 @@ class SyndicatedItem(models.Model): ('1', "Unsent"), ('2', "Sent"), ) - status = models.CharField(max_length=1, choices=STATUS, null=True, blank=True) + status = models.CharField(max_length=1, choices=STATUS, null=True) rel_link = models.CharField(max_length=300, null=True, blank=True) def __str__(self): @@ -34,16 +34,17 @@ class SyndicatedItem(models.Model): return ','.join(str(synd) for synd in self.syndicate.all()) - @receiver(post_save, sender=SyndicatedItem) def post_save_events(sender, update_fields, created, instance, **kwargs): - if instance.status == 1: + print(instance.status) + if instance.status == "1": + print("---------calling-----------") for item in instance.syndicate.all(): if item.name == "Medium": instance.rel_link = post_to_medium(instance.content_object) instance.status = 2 if item.name == "Facebook": - build_facebook_feed(instance) + build_facebook_feed() instance.status = 2 post_save.disconnect(post_save_events, sender=SyndicatedItem) instance.save() |