summaryrefslogtreecommitdiff
path: root/app/syndication/models.py
diff options
context:
space:
mode:
Diffstat (limited to 'app/syndication/models.py')
-rw-r--r--app/syndication/models.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/app/syndication/models.py b/app/syndication/models.py
index 7ddb941..6e4fd1c 100644
--- a/app/syndication/models.py
+++ b/app/syndication/models.py
@@ -4,7 +4,7 @@ from django.contrib.contenttypes.fields import GenericForeignKey
from django.db.models.signals import post_save
from django.dispatch import receiver
-from .syndicators import post_to_medium, build_facebook_feed
+from .syndicators import post_to_medium, build_facebook_feed, post_photo_to_twitter, post_photo_to_flickr
class Syndicate(models.Model):
@@ -43,9 +43,15 @@ def post_save_events(sender, update_fields, created, instance, **kwargs):
if item.name == "Medium":
instance.rel_link = post_to_medium(instance.content_object)
instance.status = 2
- if item.name == "Facebook":
+ if item.name == "Facebook Instant Articles":
build_facebook_feed()
instance.status = 2
+ if item.name == "Twitter":
+ if instance.content_type.name == "LuxPhoto":
+ post_photo_to_twitter(instance.content_object)
+ if item.name == "Flickr":
+ if instance.content_type.name == "LuxPhoto":
+ post_photo_to_flickr(instance.content_object)
post_save.disconnect(post_save_events, sender=SyndicatedItem)
instance.save()
post_save.connect(post_save_events, sender=SyndicatedItem)