forms: keep manager on front if ?debug=x is given (#26503)

This commit is contained in:
Frédéric Péters 2018-09-18 09:59:08 +02:00
parent 1833a87f71
commit 382af780b6
1 changed files with 3 additions and 2 deletions

View File

@ -228,9 +228,10 @@ class FormStatusPage(Directory, FormTemplateMixin):
def _q_index(self):
mine = self.check_auth()
if not mine and not get_request().is_in_backoffice():
# access authorized but the form doesn't belong to the user; if the
# Access authorized but the form doesn't belong to the user; if the
# user has access to the backoffice, redirect.
if get_request().user.can_go_in_backoffice():
# Unless ?debug=whatever is set.
if get_request().user.can_go_in_backoffice() and not get_request().form.get('debug'):
return redirect(self.filled.get_url(backoffice=True))
get_logger().info('form %s - id: %s - view' % (self.formdef.name, self.filled.id))