]> git.openstreetmap.org Git - osqa.git/blobdiff - forum/actions/node.py
be able to pass additional context to the _edit_question view
[osqa.git] / forum / actions / node.py
index c26a53a07b27400c4bfcc1c6d05b5c09ce324443..5ba6e2bfe0f1904f6571d6974bdecf5aff0ec5b9 100644 (file)
@@ -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") % {