Ticket #8908: fix_modelform_unique_check.diff

File fix_modelform_unique_check.diff, 748 bytes (added by jamiequint, 15 years ago)
  • forms/models.py

     
    216216        # Make sure the unique checks apply to actual fields on the ModelForm
    217217        for name, field in self.fields.items():
    218218            try:
    219                 f = self.instance._meta.get_field_by_name(name)[0]
     219                field = self.instance._meta.get_field_by_name(name)
     220                if not field[2]:
     221                    raise FieldDoesNotExist
     222                else:
     223                    f = field[0]
    220224            except FieldDoesNotExist:
    221225                # This is an extra field that's not on the ModelForm, ignore it
    222226                continue
Back to Top