Project

General

Profile

Bug #6883

save_key_values() fails if an authn request is replayed

Added by Benjamin Dauvergne almost 5 years ago. Updated almost 5 years ago.

Status:
Fermé
Priority:
Normal
Category:
-
Target version:
Start date:
01 Apr 2015
Due date:
% Done:

100%

Patch proposed:
Yes
Planning:
No

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.

0001-Use-get_or_create-to-create-KeyValue-instances-so-th.patch View (1.15 KB) Benjamin Dauvergne, 01 Apr 2015 06:03 PM

Associated revisions

Revision 434e3e6e (diff)
Added by Benjamin Dauvergne almost 5 years ago

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.

Revision 6491033c (diff)
Added by Benjamin Dauvergne almost 5 years ago

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.

History

#1 Updated by Benjamin Dauvergne almost 5 years ago

#2 Updated by Benjamin Dauvergne almost 5 years ago

  • % Done changed from 0 to 100
  • Status changed from Nouveau to Résolu (à déployer)

#4 Updated by Benjamin Dauvergne almost 5 years ago

  • Target version changed from 2.2.0 to 2.1.14

#5 Updated by Benjamin Dauvergne almost 5 years ago

  • Status changed from Résolu (à déployer) to Fermé

Also available in: Atom PDF