From: jordan Date: Sun, 4 Dec 2011 12:29:49 +0000 (+0000) Subject: add a new message to the user message_set that notifies the poster on AskAction and... X-Git-Tag: live~110 X-Git-Url: https://git.openstreetmap.org./osqa.git/commitdiff_plain/e190c5ffe5aca424f8f719882e3383a6025a6ada add a new message to the user message_set that notifies the poster on AskAction and AnswerAction git-svn-id: http://svn.osqa.net/svnroot/osqa/trunk@1207 0cfe37f9-358a-4d5e-be75-b63607b5c754 --- diff --git a/forum/actions/node.py b/forum/actions/node.py index c26a53a..5ba6e2b 100644 --- a/forum/actions/node.py +++ b/forum/actions/node.py @@ -28,6 +28,8 @@ class AskAction(NodeEditAction): question.save() self.node = question + self.user.message_set.create(message=self.describe(self.user)) + def describe(self, viewer=None): return _("%(user)s asked %(question)s") % { 'user': self.hyperlink(self.user.get_profile_url(), self.friendly_username(viewer, self.user)), @@ -45,6 +47,9 @@ class AnswerAction(NodeEditAction): def process_action(self): self.node.question.reset_answer_count_cache() + self.user.message_set.create(message=self.describe(self.user)) + + def describe(self, viewer=None): question = self.node.parent return _("%(user)s answered %(asker)s on %(question)s") % {