Opened 7 years ago

Last modified 7 years ago

#28222 closed Bug

Django 1.11 update_or_create field validation results in different behaviours between create and update_or_create — at Version 1

Reported by: Alex Mykyta Owned by: nobody
Component: Database layer (models, ORM) Version: 1.11
Severity: Normal Keywords: 1.11
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: yes
Easy pickings: no UI/UX: no

Description (last modified by Alex Mykyta)

This is an issue related to #27118. Anthony King commented on it but that issue is closed so I am opening a new one. The field validation introduced in 1.11 update_or_create will throw a FieldError if a defaults argument contains a value that is set through an @property.setter on that model. On the other hand create continues to function correctly. Ideally they'd behave consistently.

Here is an example https://dpaste.de/UORC

Change History (1)

comment:1 by Alex Mykyta, 7 years ago

Description: modified (diff)
Note: See TracTickets for help on using tickets.
Back to Top