Bug #22751
authentic2: corrige hobo-deploy quand un attribut est réellement désactivé
0%
Description
Les attributs désactivés sont invisibles via le gestionnaire Attribute.objects.
il faut utiliser Attribute.all_objects.
à la place.
Fichiers
Demandes liées
Révisions associées
agent/authentic2: fix provisionning of attributes when an attribute is disabled (#22751)
Attribute.objects.get_or_create() can fail on an existing attribute as
the default "objects" manager of the Attribute model hide disabled
attributes, so the get() can fail but won't be able to create the
attribute.
tests: use Attribute.all_objects to get all fields (#22751)
Historique
Mis à jour par Benjamin Dauvergne il y a environ 6 ans
Mis à jour par Benjamin Dauvergne il y a environ 6 ans
Oui, mais bon là je suis tombé sur un vrai bug lié à ça.
Mis à jour par Benjamin Dauvergne il y a environ 6 ans
- Sujet changé de authentic2: corrige hobo-deploy quand un attribute est réllement désactivé à authentic2: corrige hobo-deploy quand un attribut est réellement désactivé
Mis à jour par Benjamin Dauvergne il y a environ 6 ans
- Lié à Bug #11017: ne pas avoir du tout dans authentic les champs de profil désactivés ajouté
Mis à jour par Frédéric Péters il y a environ 6 ans
- Fichier 0001-agent-authentic2-use-Attribute.disabled-field-to-dis.patch 0001-agent-authentic2-use-Attribute.disabled-field-to-dis.patch ajouté
- Statut changé de Nouveau à En cours
0002 n'avait pas de quoi réactiver un attribut désactivé.
Mais tant qu'à utiliser l'attribut disabled d'authentic, autant y aller tout à fait, plus besoin de changer les autres paramètres, il me semble. (patch modifié attaché)
(cela étant, toucher à .objects, je trouve que ça donne un résultat plutôt violent côté /admin/ d'authentic)
Mis à jour par Benjamin Dauvergne il y a environ 6 ans
- Statut changé de En cours à Résolu (à déployer)
commit 79da1603bd6371ee003e136601a7e5d50b34e516 Author: Benjamin Dauvergne <bdauvergne@entrouvert.com> Date: Thu Mar 22 22:15:06 2018 +0100 agent/authentic2: use Attribute.disabled field to disable an attribute (#22751)
Mis à jour par Frédéric Péters il y a environ 6 ans
Il manque ton 0001-agent-authentic2-fix-provisionning-of-attributes-whe.patch.
Mis à jour par Frédéric Péters il y a environ 6 ans
Et une correction aux tests pour également utiliser all_objects.
commit 661fd751a642e6e09fa756abe83380d304be3072 Author: Frédéric Péters <fpeters@entrouvert.com> Date: Thu Mar 29 15:47:50 2018 +0200 tests: use Attribute.all_objects to get all fields (#22751) commit 411e94363abf2289ab6b62ab2eafaf871d32e9ac Author: Benjamin Dauvergne <bdauvergne@entrouvert.com> Date: Thu Mar 22 22:12:50 2018 +0100 agent/authentic2: fix provisionning of attributes when an attribute is disabled (#22751) Attribute.objects.get_or_create() can fail on an existing attribute as the default "objects" manager of the Attribute model hide disabled attributes, so the get() can fail but won't be able to create the attribute.
Mis à jour par Frédéric Péters il y a plus de 5 ans
- Statut changé de Résolu (à déployer) à Solution déployée
agent/authentic2: use Attribute.disabled field to disable an attribute (#22751)