Projet

Général

Profil

Development #44793

crash sur /api/dashboard/auto-tile/

Ajouté par Nicolas Roche il y a presque 4 ans. Mis à jour il y a presque 4 ans.

Statut:
Rejeté
Priorité:
Normal
Assigné à:
-
Version cible:
-
Début:
03 juillet 2020
Echéance:
% réalisé:

0%

Temps estimé:
Patch proposed:
Non
Planning:
Non

Description

trace depuis portail-citoyen.guichet-recette.grandlyon.com :

Internal Server Error: /api/dashboard/auto-tile/fontaine-eau-potable/

KeyError at /api/dashboard/auto-tile/fontaine-eau-potable/
'fontaine-eau-potable'

Request Method: POST
Request URL: https://portail-citoyen.guichet-recette.grandlyon.com/api/dashboard/auto-tile/fontaine-eau-potable/
Django Version: 1.11.20
Python Executable: /usr/bin/uwsgi-core
Python Version: 3.5.3
Python Path: ['.', '', '/usr/lib/python35.zip', '/usr/lib/python3.5', '/usr/lib/python3.5/plat-x86_64-linux-gnu',
+'/usr/lib/python3.5/lib-dynload', '/usr/local/lib/python3.5/dist-packages', '/usr/lib/python3/dist-packages']
Server time: ven, 3 Jul 2020 12:14:35 +0200
Installed Applications:
''
Installed Middleware:
''

Traceback:

File "/usr/lib/python3/dist-packages/django/core/handlers/exception.py" in inner
  41.             response = get_response(request)

File "/usr/lib/python3/dist-packages/django/core/handlers/base.py" in _get_response
  187.                 response = self.process_exception_by_middleware(e, request)

File "/usr/lib/python3/dist-packages/django/core/handlers/base.py" in _get_response
  185.                 response = wrapped_callback(request, *callback_args, **callback_kwargs)

File "/usr/lib/python3/dist-packages/django/views/decorators/csrf.py" in wrapped_view
  58.         return view_func(*args, **kwargs)

File "/usr/lib/python3/dist-packages/combo/apps/dashboard/views.py" in dashboard_auto_tile
  119.     cell_form_keys = [x['varname'] for x in settings.JSON_CELL_TYPES[cell.key].get('form') or {}]

Exception Type: KeyError at /api/dashboard/auto-tile/fontaine-eau-potable/
Exception Value: 'fontaine-eau-potable'

Historique

#1

Mis à jour par Nicolas Roche il y a presque 4 ans

Je peux reproduire dans les tests de combo en mettant un mauvais nom de tuile :

$ git diff -U1
diff --git a/tests/test_dashboard.py b/tests/test_dashboard.py
index da4e8578..e3ff9c6c 100644
--- a/tests/test_dashboard.py
+++ b/tests/test_dashboard.py
@@ -209,2 +209,9 @@ def test_auto_tile(app, site):
                     content_type='application/json')
+
+            # unknown key
+            app = login(app)
+            resp = app.post(reverse('combo-dashboard-auto-tile', kwargs={'key': 'unknown'}),
+                    params=json.dumps({'var1': 'one', 'var2': 'two'}),
+                    content_type='application/json')
+
             assert resp.text.strip() == '/var1=one/var2=/'

Mais ça me semble compliqué à corriger.
Peut-être que ce serait quelque-chose à corriger directement sur GL ?

#2

Mis à jour par Frédéric Péters il y a presque 4 ans

  • Statut changé de Nouveau à Rejeté

Formats disponibles : Atom PDF