Opened 5 years ago

Last modified 5 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 Changed 5 years ago by Alex Mykyta

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