mirror of
https://github.com/django/django.git
synced 2025-10-26 15:16:09 +00:00
Fixed #25241 -- Corrected ModelForm.save() error message when saving invalid form with UUIDField pk.
This commit is contained in:
@@ -454,7 +454,7 @@ class BaseModelForm(BaseForm):
|
||||
If commit=True, then the changes to ``instance`` will be saved to the
|
||||
database. Returns ``instance``.
|
||||
"""
|
||||
if self.instance.pk is None:
|
||||
if self.instance._state.adding:
|
||||
fail_message = 'created'
|
||||
else:
|
||||
fail_message = 'changed'
|
||||
|
||||
Reference in New Issue
Block a user