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 Initial Version
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
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
Note:
See TracTickets
for help on using tickets.