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):
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)),
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") % {