]> git.openstreetmap.org Git - osqa.git/blobdiff - forum/actions/node.py
Merge pull request #26 from udacity/remove_dj_version
[osqa.git] / forum / actions / node.py
index 5ba6e2bfe0f1904f6571d6974bdecf5aff0ec5b9..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,7 +30,7 @@ class AskAction(NodeEditAction):
         question.save()
         self.node = question
 
-        self.user.message_set.create(message=self.describe(self.user))
+        messages.info(REQUEST_HOLDER.request, self.describe(self.user))
 
     def describe(self, viewer=None):
         return _("%(user)s asked %(question)s") % {
@@ -47,7 +49,7 @@ class AnswerAction(NodeEditAction):
     def process_action(self):
         self.node.question.reset_answer_count_cache()
 
-        self.user.message_set.create(message=self.describe(self.user))
+        messages.info(REQUEST_HOLDER.request, self.describe(self.user))
 
 
     def describe(self, viewer=None):