]> git.openstreetmap.org Git - osqa.git/commitdiff
add a new message to the user message_set that notifies the poster on AskAction and...
authorjordan <jordan@0cfe37f9-358a-4d5e-be75-b63607b5c754>
Sun, 4 Dec 2011 12:29:49 +0000 (12:29 +0000)
committerjordan <jordan@0cfe37f9-358a-4d5e-be75-b63607b5c754>
Sun, 4 Dec 2011 12:29:49 +0000 (12:29 +0000)
git-svn-id: http://svn.osqa.net/svnroot/osqa/trunk@1207 0cfe37f9-358a-4d5e-be75-b63607b5c754

forum/actions/node.py

index c26a53a07b27400c4bfcc1c6d05b5c09ce324443..5ba6e2bfe0f1904f6571d6974bdecf5aff0ec5b9 100644 (file)
@@ -28,6 +28,8 @@ class AskAction(NodeEditAction):
         question.save()
         self.node = question
 
         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)),
     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()
 
     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") % {
     def describe(self, viewer=None):
         question = self.node.parent
         return _("%(user)s answered %(asker)s on %(question)s") % {