Bug #6883
save_key_values() fails if an authn request is replayed
Début:
01 avril 2015
Echéance:
% réalisé:
100%
Temps estimé:
Patch proposed:
Oui
Planning:
Description
When KeyValue(key=..., value...).save() is executed two times with the same key, the second time Django try to write a NULL value in the created
field. We should just use get_or_create()
to work around that.
Fichiers
Révisions associées
saml: use get_or_create() in save_key_values (fixes #6883)
With a simple Model.save() the second save in case of replay fails
because the created is updated to the NULL value. It seem that
initialization of DateTime field is ignored when Django detects that a
save is an UPDATE and not an INSERT.
Historique
Mis à jour par Benjamin Dauvergne il y a presque 9 ans
- Fichier 0001-Use-get_or_create-to-create-KeyValue-instances-so-th.patch 0001-Use-get_or_create-to-create-KeyValue-instances-so-th.patch ajouté
- Patch proposed changé de Non à Oui
Mis à jour par Benjamin Dauvergne il y a presque 9 ans
- Statut changé de Nouveau à Résolu (à déployer)
- % réalisé changé de 0 à 100
Appliqué par commit 434e3e6e6ea7188241caa3ca0b934fb7d7323e38.
Mis à jour par Benjamin Dauvergne il y a presque 9 ans
Appliqué par commit 6491033c80f0ccf843a73721828103282e769c72.
Mis à jour par Benjamin Dauvergne il y a presque 9 ans
- Statut changé de Résolu (à déployer) à Fermé
saml: use get_or_create() in save_key_values (fixes #6883)
With a simple Model.save() the second save in case of replay fails
because the created is updated to the NULL value. It seem that
initialization of DateTime field is ignored when Django detects that a
save is an UPDATE and not an INSERT.