mirror of
https://github.com/django/django.git
synced 2025-08-03 10:34:04 +00:00
Fixed #25241 -- Corrected ModelForm.save() error message when saving invalid form with UUIDField pk.
This commit is contained in:
parent
3e1bb5cfb8
commit
f2b665f886
4 changed files with 37 additions and 2 deletions
|
@ -11,6 +11,7 @@ from __future__ import unicode_literals
|
|||
import datetime
|
||||
import os
|
||||
import tempfile
|
||||
import uuid
|
||||
|
||||
from django.core import validators
|
||||
from django.core.exceptions import ValidationError
|
||||
|
@ -447,3 +448,8 @@ class Photo(models.Model):
|
|||
def save(self, force_insert=False, force_update=False):
|
||||
super(Photo, self).save(force_insert, force_update)
|
||||
self._savecount += 1
|
||||
|
||||
|
||||
class UUIDPK(models.Model):
|
||||
uuid = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False)
|
||||
name = models.CharField(max_length=30)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue