]> git.openstreetmap.org Git - osqa.git/blobdiff - forum/actions/node.py
Merge pull request #5 from lra/french
[osqa.git] / forum / actions / node.py
index c26a53a07b27400c4bfcc1c6d05b5c09ce324443..8a4760b0aa72e0cd0ca48b4730fb1cae7731840d 100644 (file)
@@ -2,7 +2,9 @@ from django.utils.html import strip_tags
 from django.utils.translation import ugettext as _
 from forum.models.action import ActionProxy
 from forum.models import Comment, Question, Answer, NodeRevision
-import logging
+from forum import settings, REQUEST_HOLDER
+
+from django.contrib import messages
 
 class NodeEditAction(ActionProxy):
     def create_revision_data(self, initial=False, **data):
@@ -28,6 +30,8 @@ class AskAction(NodeEditAction):
         question.save()
         self.node = question
 
+        messages.info(REQUEST_HOLDER.request, 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 +49,9 @@ class AnswerAction(NodeEditAction):
     def process_action(self):
         self.node.question.reset_answer_count_cache()
 
+        messages.info(REQUEST_HOLDER.request, self.describe(self.user))
+
+
     def describe(self, viewer=None):
         question = self.node.parent
         return _("%(user)s answered %(asker)s on %(question)s") % {