Don't notify the player of private comments.
authorMatthijs Kooijman <matthijs@stdin.nl>
Sun, 16 Nov 2008 16:48:40 +0000 (17:48 +0100)
committerMatthijs Kooijman <matthijs@stdin.nl>
Sun, 16 Nov 2008 16:48:40 +0000 (17:48 +0100)
influences/notify.py

index e5c763ae36b40dea3d20b39d324233b8aad15378..1b6fb478253eec2361aa2147acff32354bbe4bb7 100644 (file)
@@ -26,14 +26,19 @@ def comment_saved(**kwargs):
         return
 
     comment = kwargs['instance']
+
     # We don't support comment editing, but let's check this anyway
     if not kwargs['created']:
         return
 
     object = comment.content_object
     if isinstance(object, Influence):
+        recipients = ['lextalionis@evolution-events.nl']
+        if comment.is_public:
+            recipients.append(object.character.player)
+
         notify(
-            [object.character.player, 'matthijs@stdin.nl'],
+            recipients,
             'influences/email/influence_comment_added.html',
             {'comment'   : comment, 
              'influence' : object,