]> git.openstreetmap.org Git - osqa.git/commitdiff
Some fixes on subscriptions.
authorhernani <hernani@0cfe37f9-358a-4d5e-be75-b63607b5c754>
Mon, 10 May 2010 18:48:55 +0000 (18:48 +0000)
committerhernani <hernani@0cfe37f9-358a-4d5e-be75-b63607b5c754>
Mon, 10 May 2010 18:48:55 +0000 (18:48 +0000)
git-svn-id: http://svn.osqa.net/svnroot/osqa/trunk@198 0cfe37f9-358a-4d5e-be75-b63607b5c754

forum/subscriptions.py

index 3fa4c69ffda8e592c65a9e6912a6f25a27f00844..45f430fb78e217ebf1692ab0ebb8d3604de8b273 100644 (file)
@@ -124,7 +124,7 @@ def answer_accepted(action, new):
             subscription_settings__enable_notifications=True,\r
             subscription_settings__notify_accepted=True,\r
             subscription_settings__subscribed_questions='i'\r
-    ).exclude(id=instance.accepted_by.id).distinct()\r
+    ).exclude(id=action.node.accepted.by.id).distinct()\r
     recipients = create_recipients_dict(subscribers)\r
 \r
     send_email(settings.EMAIL_SUBJECT_PREFIX + _("An answer to '%(question_title)s' was accepted") % dict(question_title=question.title),\r
@@ -144,7 +144,7 @@ def member_joined(action, new):
 \r
     recipients = create_recipients_dict(subscribers)\r
 \r
-    send_email(settings.EMAIL_SUBJECT_PREFIX + _("%(username)s is a new member on %(app_name)s") % dict(username=instance.username, app_name=settings.APP_SHORT_NAME),\r
+    send_email(settings.EMAIL_SUBJECT_PREFIX + _("%(username)s is a new member on %(app_name)s") % dict(username=action.user.username, app_name=settings.APP_SHORT_NAME),\r
                recipients, "notifications/newmember.html", {\r
         'newmember': action.user,\r
     }, threaded=False)\r