Development #41439
options doit être un dict (était: AttributeError: 'str' object has no attribute 'get')
Début:
08 avril 2020
Echéance:
% réalisé:
0%
Temps estimé:
Patch proposed:
Oui
Planning:
Non
Description
https://sentry.entrouvert.org/entrouvert/publik/issues/1358/
AttributeError: 'str' object has no attribute 'get' (9 additional frame(s) were not displayed) ... File "django/views/generic/edit.py", line 45, in get_form return form_class(**self.get_form_kwargs()) File "combo/apps/lingo/forms.py", line 59, in __init__ self.instance.payment_backend.get_payment().get_parameters(scope='transaction'), File "combo/apps/lingo/models.py", line 113, in get_payment return eopayment.Payment(self.service, self.service_options) File "__init__.py", line 90, in __init__ self.backend = get_backend(kind)(options, logger=logger) File "eopayment/common.py", line 133, in __init__ setattr(self, key, options.get(key, None) or value['default']) Internal Server Error: /manage/lingo/regies/2/edit
Fichiers
Révisions associées
lingo: validate service_options in forms (#41439)
Historique
Mis à jour par Lauréline Guérin il y a environ 4 ans
- Projet changé de Suivi des traces à EOPayment
Mis à jour par Benjamin Dauvergne il y a environ 4 ans
- Projet changé de EOPayment à Lingo
- Sujet changé de AttributeError: 'str' object has no attribute 'get' à options doit être un dict (était: AttributeError: 'str' object has no attribute 'get')
Mis à jour par Benjamin Dauvergne il y a environ 4 ans
- Fichier 0002-lingo-validate-service_options-in-forms-41439.patch 0002-lingo-validate-service_options-in-forms-41439.patch ajouté
- Fichier 0001-lingo-backend-options-must-be-dict-41439.patch 0001-lingo-backend-options-must-be-dict-41439.patch ajouté
- Tracker changé de Bug à Development
- Statut changé de Nouveau à Solution proposée
- Patch proposed changé de Non à Oui
Mis à jour par Frédéric Péters il y a environ 4 ans
+def validate_dict(value): + if not isinstance(value, dict): + raise ValidationError(_('Value must a JSON array'))
... a JSON object?
Mis à jour par Benjamin Dauvergne il y a environ 4 ans
- Fichier 0002-lingo-validate-service_options-in-forms-41439.patch 0002-lingo-validate-service_options-in-forms-41439.patch ajouté
- Fichier 0001-lingo-backend-options-must-be-dict-41439.patch 0001-lingo-backend-options-must-be-dict-41439.patch ajouté
Ouaip, un reste de PHP m'a pollué l'esprit.
Mis à jour par Nicolas Roche il y a environ 4 ans
(ça vaudrait pas le coup d'écrire un test, pour entretenir le taux de couverture indécent sur combo ?)
Mis à jour par Frédéric Péters il y a environ 4 ans
- Statut changé de Solution proposée à Solution validée
Autour de ce champ le vrai truc à faire est #41622 (ou une version passée de ce ticket que je ne trouve pas).
Mis à jour par Benjamin Dauvergne il y a environ 4 ans
- Statut changé de Solution validée à Résolu (à déployer)
commit 90a7560e98877fbc625d3d2c08bac34c41473983 Author: Benjamin Dauvergne <bdauvergne@entrouvert.com> Date: Wed Apr 8 10:02:09 2020 +0200 lingo: validate service_options in forms (#41439) commit ead8de9bcca665756bc2585c8842e186e593f560 Author: Benjamin Dauvergne <bdauvergne@entrouvert.com> Date: Wed Apr 8 09:59:48 2020 +0200 lingo: backend options must be dict (#41439)
Mis à jour par Frédéric Péters il y a environ 4 ans
- Statut changé de Résolu (à déployer) à Solution déployée
lingo: backend options must be dict (#41439)