From a3f49bbe0dfd48f6962a486274eaf4fd1f0797dd Mon Sep 17 00:00:00 2001 From: Samuel Clay Date: Mon, 16 Apr 2012 20:10:00 -0700 Subject: [PATCH] No dupe follow activities or interactions. --- apps/social/models.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/apps/social/models.py b/apps/social/models.py index 32487a4c5..39cee4e29 100644 --- a/apps/social/models.py +++ b/apps/social/models.py @@ -1136,9 +1136,9 @@ class MInteraction(mongo.Document): @classmethod def new_follow(cls, follower_user_id, followee_user_id): - cls.objects.create(user_id=followee_user_id, - with_user_id=follower_user_id, - category='follow') + cls.objects.get_or_create(user_id=followee_user_id, + with_user_id=follower_user_id, + category='follow') @classmethod def new_comment_reply(cls, user_id, reply_user_id, reply_content, social_feed_id, story_id): @@ -1219,9 +1219,9 @@ class MActivity(mongo.Document): @classmethod def new_follow(cls, follower_user_id, followee_user_id): - cls.objects.create(user_id=follower_user_id, - with_user_id=followee_user_id, - category='follow') + cls.objects.get_or_create(user_id=follower_user_id, + with_user_id=followee_user_id, + category='follow') @classmethod def new_comment_reply(cls, user_id, comment_user_id, reply_content, story_feed_id, story_id):