request, *args, **kwargs): self.object = self.get_object() rate = kwargs.get('rate') @@ -291,39 +326,13 @@ class RateProposal(BaseProposalView, UpdateView): 'view_event', kwargs={'slug': proposal.event.slug}) if not self.request.user.is_authenticated(): - message = _(u'You need to be logged in to ' . . . - json.dumps(response), - status=401, - content_type='application/json' - ) + return self.not_authenticated_redirect(url=view_event_url) + elif not proposal.user_can_approve(self.request.user): + return self.not_allowed_redirect(url=view_event_url) return super(RateProposal, self).dispatch(*args, **kwargs)