Ticket #17761: django-17761.patch
File django-17761.patch, 824 bytes (added by , 13 years ago) |
---|
-
django/db/models/base.py
500 500 # At this point, parent's primary key field may be unknown 501 501 # (for example, from administration form which doesn't fill 502 502 # this field). If so, fill it. 503 if field and getattr(self, parent._meta.pk.attname) i s Noneand getattr(self, field.attname) is not None:503 if field and getattr(self, parent._meta.pk.attname) in [None, ''] and getattr(self, field.attname) is not None: 504 504 setattr(self, parent._meta.pk.attname, getattr(self, field.attname)) 505 505 506 506 self.save_base(cls=parent, origin=org, using=using)