Projet

Général

Profil

Bug #52071

crash en cas de saisie backoffice sans info de contexte et pas d'accès à la demande saisie pour l'agent

Ajouté par Frédéric Péters il y a environ 3 ans. Mis à jour il y a environ 3 ans.

Statut:
Fermé
Priorité:
Normal
Assigné à:
-
Version cible:
-
Début:
16 mars 2021
Echéance:
% réalisé:

0%

Temps estimé:
Patch proposed:
Oui
Planning:
Non

Description

Exception:
  type = '<class 'AttributeError'>', value = ''NoneType' object has no attribute 'get''

Stack trace (most recent call first):
  File "/usr/lib/python3/dist-packages/wcs/backoffice/submission.py", line 353, in submitted
   351             # redirect to the defined return URL or to the submission
   352             # homepage
>  353             if filled.submission_context.get('return_url'):
   354                 url = filled.submission_context['return_url']
   355             else:

Initialement submission_context contenait dans cette situation à coup sûr l'identifiant de l'agent mais ça a été déplacé vers un attribut à part, on peut donc se trouver avec submission_context à None.


Fichiers

Révisions associées

Révision 16d50764 (diff)
Ajouté par Frédéric Péters il y a environ 3 ans

backoffice: fix redirection to submission page for users with no rights (#52071)

Révision b5ee70fb (diff)
Ajouté par Frédéric Péters il y a environ 3 ans

backoffice: fix redirection to submission page for users with no rights (#52071)

Historique

#1

Mis à jour par Frédéric Péters il y a environ 3 ans

#3

Mis à jour par Lauréline Guérin il y a environ 3 ans

  • Statut changé de Solution proposée à Solution validée

pas de test de non régression ? :)

#4

Mis à jour par Frédéric Péters il y a environ 3 ans

  • Statut changé de Solution validée à Résolu (à déployer)

Non, en fait test_backoffice_submission_dispatch devrait couvrir ça mais quelque chose de particulier se cache et je n'ai creusé.

    resp = app.get('/backoffice/submission/')

    resp = resp.click(formdef.name)
    resp.form['f1'] = 'test submission'
    resp = resp.form.submit('submit')  # to validation screen
    resp = resp.form.submit('submit')  # final submit
    # should NOT go to the formdata
    assert resp.location == 'http://example.net/backoffice/submission/'
commit 16d50764c89f7ab3d55a3b3f508f22918bc03107
Author: Frédéric Péters <fpeters@entrouvert.com>
Date:   Tue Mar 16 07:30:50 2021 +0100

    backoffice: fix redirection to submission page for users with no rights (#52071)
#5

Mis à jour par Frédéric Péters il y a environ 3 ans

  • Statut changé de Résolu (à déployer) à Solution déployée

Formats disponibles : Atom PDF