Ticket #13811: formset_validation.diff
File formset_validation.diff, 1.1 KB (added by , 14 years ago) |
---|
-
django/forms/models.py
510 510 # it's already invalid 511 511 if not hasattr(form, "cleaned_data"): 512 512 continue 513 # get each of the fields for which we have data on this form 514 if [f for f in unique_check if f in form.cleaned_data and form.cleaned_data[f] is not None]: 515 # get the data itself 516 row_data = tuple([form.cleaned_data[field] for field in unique_check]) 513 # get data for each field of each of unique_check 514 row_data = tuple([form.cleaned_data[field] for field in unique_check if field in form.cleaned_data]) 515 if row_data and not None in row_data: 517 516 # if we've aready seen it then we have a uniqueness failure 518 517 if row_data in seen_data: 519 518 # poke error messages into the right places and mark