Merge pull request #565 from smilerz/login_redirect

login redirect to intended page
This commit is contained in:
vabene1111
2021-05-20 14:47:24 +02:00
committed by GitHub

View File

@@ -120,8 +120,8 @@ class GroupRequiredMixin(object):
def dispatch(self, request, *args, **kwargs):
if not has_group_permission(request.user, self.groups_required):
messages.add_message(request, messages.ERROR, _('You do not have the required permissions to view this page!'))
return HttpResponseRedirect(reverse_lazy('index'))
messages.add_message(request, messages.ERROR, _('You are not logged in and therefore cannot view this page!'))
return HttpResponseRedirect(reverse_lazy('account_login') + '?next=' + request.path)
try:
obj = self.get_object()