#22539 closed Bug (fixed)
Model.full_clean() mutates exclude argument
Reported by: | Owned by: | nobody | |
---|---|---|---|
Component: | Database layer (models, ORM) | Version: | dev |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Accepted | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | yes | UI/UX: | no |
Description
If model.full_clean() gets a list argument for exclude
, and after running clean_fields() errors are raised, it appends the names of those fields to the exclude
argument, mutating it and causing a really bad side effect which is not expected by the user.
Instead, the list should be copied if it is not None.
Change History (6)
comment:1 by , 11 years ago
Has patch: | unset |
---|---|
Triage Stage: | Unreviewed → Accepted |
comment:2 by , 11 years ago
comment:3 by , 11 years ago
Yes please, go ahead and make sure to include tests and link the PR to this Trac issue.
comment:5 by , 11 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Note:
See TracTickets
for help on using tickets.
I have patch ready, shall I send a pull request under a new branch ticket_22539?