Projet

Général

Profil

Bug #64616

usage de self.var dans LazyFormData.get

Ajouté par Thomas Noël il y a presque 2 ans. Mis à jour il y a presque 2 ans.

Statut:
Rejeté
Priorité:
Normal
Assigné à:
-
Version cible:
-
Début:
27 avril 2022
Echéance:
% réalisé:

0%

Temps estimé:
Patch proposed:
Non
Planning:
Non

Description

Dans LazyFormData.get :

    def get(self, key):
        # compatibility with |get filter, to return a field by varname
        try:
            return getattr(self.var, key)
        except AttributeError:
            # fallback to CompatibilityNamesDict, this allows filters to do
            # queryset|first|get:"form_var_plop" 
            compat_dict = CompatibilityNamesDict({'form': self})
            return compat_dict.get(key)

Le self.var utilisé dans le try me semble ne jamais exister...? Et donc on serait toujours dans le cas AttributeError.

Historique

#1

Mis à jour par Thomas Noël il y a presque 2 ans

  • Statut changé de Nouveau à Rejeté

Et on m'oublie

    @property
    def var(self):
        return LazyFormDataVar(self._formdef.get_all_fields(), self._formdata.data, self._formdata)

Formats disponibles : Atom PDF