id summary reporter owner description type status component version severity resolution keywords cc stage has_patch needs_docs needs_tests needs_better_patch easy ui_ux 28283 _changeform_view sends wrong object after ModelForm validation ddein "I noticed strange behavior when changing the form of the admin. If I try to save the form with an error, some functions (`get_fieldsets`, `get_prepopulated_fields`, `get_readonly_fields`, `get_inline_formsets`, something else) get the wrong object after validation. See here: https://github.com/django/django/blob/master/django/contrib/admin/options.py#L1436-L1437 It seems to me not obvious, that after call `is_valid`, object `obj` will be changed. The quick solution for me was the following: {{{ form = ModelForm(request.POST, request.FILES, instance=copy.copy(obj)) }}} But maybe the problem elsewhere. Has anyone encountered a similar one, is this a mistake or normal behavior?" Bug new contrib.admin dev Normal Accepted 0 0 0 0 0 0