[Answered ]-Why is django form is updating user object even when the validation fails

2👍

ModelForm validation is split into two parts. After the form has called its own field and form-level validation methods, it needs to call any model validation methods, including the uniqueness validation. To do that it needs an up-to-date model instance, so it will do that first.

Normally that does not matter, because the thing you are updating is specifically queried for that purpose and not used elsewhere in the view. In your case, refreshing it explicitly from the db sounds like a good solution.

Leave a comment