fix unique checks not working on created objects
This commit is contained in:
parent
d02b0cbcbd
commit
18b556467e
1 changed files with 3 additions and 0 deletions
|
@ -121,6 +121,9 @@ class ChangeSet(models.Model):
|
|||
|
||||
obj = model()
|
||||
obj.pk = 'c' + str(pk)
|
||||
if hasattr(model._meta.pk, 'related_model'):
|
||||
setattr(obj, model._meta.pk.related_model._meta.pk.attname, obj.pk)
|
||||
obj._state.adding = False
|
||||
|
||||
for name, value in data.items():
|
||||
if name.startswith('title_'):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue