Commit d7cca36e by Őry Máté

dashboard: redirect to login page if token invalid

parent 8e306d05
...@@ -589,6 +589,8 @@ class OperationView(RedirectToLoginMixin, DetailView): ...@@ -589,6 +589,8 @@ class OperationView(RedirectToLoginMixin, DetailView):
except Exception as e: except Exception as e:
messages.error(request, _('Could not start operation.')) messages.error(request, _('Could not start operation.'))
logger.exception(e) logger.exception(e)
else:
messages.success(request, _('Operation is started.'))
return redirect("%s#activity" % self.object.get_absolute_url()) return redirect("%s#activity" % self.object.get_absolute_url())
@classmethod @classmethod
...@@ -734,6 +736,7 @@ class TokenOperationView(OperationView): ...@@ -734,6 +736,7 @@ class TokenOperationView(OperationView):
User can do the action with a valid token instead of logging in. User can do the action with a valid token instead of logging in.
""" """
token_max_age = 3 * 24 * 3600 token_max_age = 3 * 24 * 3600
redirect_exception_classes = (PermissionDenied, SuspiciousOperation, )
@classmethod @classmethod
def get_salt(cls): def get_salt(cls):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment