X-Git-Url: https://git.openstreetmap.org./osqa.git/blobdiff_plain/e190c5ffe5aca424f8f719882e3383a6025a6ada..183aa1f98a61acb441e082951ff8c24c93cfcc27:/forum/actions/node.py diff --git a/forum/actions/node.py b/forum/actions/node.py index 5ba6e2b..8a4760b 100644 --- a/forum/actions/node.py +++ b/forum/actions/node.py @@ -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):