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
question.save()
self.node = question
- messages.info(request, self.describe(self.user))
+ messages.info(REQUEST_HOLDER.request, self.describe(self.user))
def describe(self, viewer=None):
return _("%(user)s asked %(question)s") % {
def process_action(self):
self.node.question.reset_answer_count_cache()
- messages.info(request, self.describe(self.user))
+ messages.info(REQUEST_HOLDER.request, self.describe(self.user))
def describe(self, viewer=None):
from django.db.models import F
from forum.models.action import ActionProxy
from forum.models import Award, Badge, ValidationHash, User
-from forum import settings
+from forum import settings, REQUEST_HOLDER
from forum.settings import APP_SHORT_NAME
from forum.utils.mail import send_template_email
message=_("Congratulations, you have been awarded an extra %s reputation points.") % self._value +
'<br />%s' % self.extra.get('message', _('Thank you')))
else:
- messages.info(request, _("You have penalized %s in %s reputation points.") % (self._affected, self._value) +
+ messages.info(REQUEST_HOLDER.request, _("You have penalized %s in %s reputation points.") % (self._affected, self._value) +
'<br />%s' % self.extra.get('message', ''))
def describe(self, viewer=None):