Author: brosner
Date: Mon Oct 13 15:27:25 2008
New Revision: 52
Modified:
trunk/friendsdev/friends/models.py
Log:
Avoid many calls to notification.send in JoinInvitation.accept for
friends_otherconnect.
Modified: trunk/friendsdev/friends/models.py
==============================================================================
--- trunk/friendsdev/friends/models.py (original)
+++ trunk/friendsdev/friends/models.py Mon Oct 13 15:27:25 2008
@@ -144,9 +144,11 @@
# notify
if notification:
notification.send([self.from_user], "join_accept",
{"invitation": self, "new_user": new_user})
+ friends = []
for user in friend_set_for(new_user) |
friend_set_for(self.from_user):
if user != new_user and user != self.from_user:
- notification.send([user], "friends_otherconnect",
{"invitation": self, "to_user": new_user})
+ friends.append(users)
+ notification.send(friends, "friends_otherconnect",
{"invitation": self, "to_user": new_user})
class FriendshipInvitation(models.Model):
"""
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"pinax-updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/pinax-updates?hl=en
-~----------~----~----~----~------~----~------~--~---