This is relevant for Forms and ModelForms that modify the error messages
of their fields dynamically: while each instance of the specific form
(e.g., `ProfileForm`) is expected to have a set of fields “sealed” away
from other instances of the same `ProfileForm`
(https://github.com/django/django/blob/146086f219d01dbb1cd8c089b5a5667e396e1cc4/django/forms/forms.py#L95),
in fact all these instances share the same error messages, resulting in
incorrectly raised errors.
Confirmed for versions of Django going back to 1.11.
--
Ticket URL: <https://code.djangoproject.com/ticket/30839>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* version: 1.11 => master
* stage: Unreviewed => Accepted
Comment:
Thanks for this report. I attached a simple test.
Reproduced at f52022ad96356d4b1061610f2b74ea4d1956a608.
--
Ticket URL: <https://code.djangoproject.com/ticket/30839#comment:1>
* Attachment "test-30839.diff" added.
Simple test.
* owner: nobody => Hasan Ramezani
* status: new => assigned
--
Ticket URL: <https://code.djangoproject.com/ticket/30839#comment:2>
* has_patch: 0 => 1
--
Ticket URL: <https://code.djangoproject.com/ticket/30839#comment:3>
* status: assigned => closed
* resolution: => fixed
Comment:
In [changeset:"a28d1b38e55cf588cfaae97de6a575d5c9f90a96" a28d1b3]:
{{{
#!CommitTicketReference repository=""
revision="a28d1b38e55cf588cfaae97de6a575d5c9f90a96"
Fixed #30839 -- Fixed Field.__deepcopy__() so forms don't share error
messages.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/30839#comment:4>
Comment (by Mariusz Felisiak <felisiak.mariusz@…>):
In [changeset:"7c70aa8f6376d761bd6d4bc075d232ee6e91f8f2" 7c70aa8f]:
{{{
#!CommitTicketReference repository=""
revision="7c70aa8f6376d761bd6d4bc075d232ee6e91f8f2"
[3.0.x] Fixed #30839 -- Fixed Field.__deepcopy__() so forms don't share
error messages.
Backport of a28d1b38e55cf588cfaae97de6a575d5c9f90a96 from master
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/30839#comment:5>