Skip to content

Commit

Permalink
Fixed #344 - Added remove manager to remove bi-directional friendship…
Browse files Browse the repository at this point in the history
… relation

Signed-off-by: James Tauber <jtauber@jtauber.com>
  • Loading branch information
alibrahim authored and jtauber committed Jul 29, 2009
1 parent b8cfb41 commit 523c739
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions friends/models.py
Expand Up @@ -63,6 +63,13 @@ def are_friends(self, user1, user2):
return True
return False

def remove(self, user1, user2):
if self.filter(from_user=user1, to_user=user2):
friendship = self.filter(from_user=user1, to_user=user2)
elif self.filter(from_user=user2, to_user=user1):
friendship = self.filter(from_user=user2, to_user=user1)
friendship.delete()


class Friendship(models.Model):
"""
Expand Down

0 comments on commit 523c739

Please sign in to comment.