`save()`
[https://github.com/django/django/blob/3e1bb5cfb8f9676e0c045f0d101a094437133b54/django/forms/models.py#L457
checks] `self.instance.pk is None` which is the incorrect condition in the
case of a model with a `UUIDField` primary key.
--
Ticket URL: <https://code.djangoproject.com/ticket/25241>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* has_patch: 0 => 1
Old description:
> self.
>
> `save()`
> [https://github.com/django/django/blob/3e1bb5cfb8f9676e0c045f0d101a094437133b54/django/forms/models.py#L457
> checks] `self.instance.pk is None` which is the incorrect condition in
> the case of a model with a `UUIDField` primary key.
New description:
`save()`
[https://github.com/django/django/blob/3e1bb5cfb8f9676e0c045f0d101a094437133b54/django/forms/models.py#L457
checks] `self.instance.pk is None` which is the incorrect condition in the
case of a model with a `UUIDField` primary key.
--
Comment:
[https://github.com/django/django/pull/5111 PR]
--
Ticket URL: <https://code.djangoproject.com/ticket/25241#comment:1>
Comment (by candeira):
Thanks for this. You're cleaning here a lot of of cruft that I left in my
own #25227 because I didn't know whether it was used from other parts of
Django.
I assume this is as good as merged. I'll rebase my patch on your one
before continuing with the #25227 discussion.
--
Ticket URL: <https://code.djangoproject.com/ticket/25241#comment:2>
* status: new => closed
* resolution: => fixed
Comment:
In [changeset:"f2b665f88610b208196b5753b09b4a5cfb322417" f2b665f8]:
{{{
#!CommitTicketReference repository=""
revision="f2b665f88610b208196b5753b09b4a5cfb322417"
Fixed #25241 -- Corrected ModelForm.save() error message when saving
invalid form with UUIDField pk.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/25241#comment:3>