Reverted support/unsupport changes (question)

This commit is contained in:
Emanuel Schuetze 2013-03-14 23:45:17 +01:00
parent 20118ae833
commit d180b4f331

View File

@ -338,8 +338,14 @@ class SupportView(SingleObjectMixin, QuestionMixin, RedirectView):
return True return True
def get_question(self): def get_question(self):
def pre_redirect(self, request, *args, **kwargs): """Return the question string."""
"""Append or remove the request.user from the motion and return success message. if self.support:
return _('Do you really want to support this motion?')
else:
return _('Do you really want to unsupport this motion?')
def case_yes(self):
"""Append or remove the request.user from the motion.
First the method checks the permissions, and writes a log message after First the method checks the permissions, and writes a log message after
appending or removing the user. appending or removing the user.
@ -352,7 +358,6 @@ class SupportView(SingleObjectMixin, QuestionMixin, RedirectView):
else: else:
self.object.unsupport(person=user) self.object.unsupport(person=user)
self.object.write_log(ugettext_noop("Supporter: -%s") % user, user) self.object.write_log(ugettext_noop("Supporter: -%s") % user, user)
messages.success(request, self.get_success_message())
def get_success_message(self): def get_success_message(self):
"""Return the success message.""" """Return the success message."""