Projet

Général

Profil

Development #41439

options doit être un dict (était: AttributeError: 'str' object has no attribute 'get')

Ajouté par Sentry Io il y a environ 4 ans. Mis à jour il y a environ 4 ans.

Statut:
Fermé
Priorité:
Normal
Assigné à:
Version cible:
-
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

Révision ead8de9b (diff)
Ajouté par Benjamin Dauvergne il y a environ 4 ans

lingo: backend options must be dict (#41439)

Révision 90a7560e (diff)
Ajouté par Benjamin Dauvergne il y a environ 4 ans

lingo: validate service_options in forms (#41439)

Historique

#1

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

  • Projet changé de Suivi des traces à EOPayment
#2

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')
#3

Mis à jour par Benjamin Dauvergne il y a environ 4 ans

  • Assigné à mis à Benjamin Dauvergne
#4

Mis à jour par Benjamin Dauvergne il y a environ 4 ans

#7

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?

#9

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 ?)

#10

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).

#11

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)
#12

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

Formats disponibles : Atom PDF