Simplifed formset iteration using enumerate().

This commit is contained in:
Jon Dufresne 2020-10-26 00:02:38 -07:00 committed by GitHub
parent 2b56c56653
commit b2717c7532
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 10 deletions

View file

@ -237,8 +237,7 @@ class BaseTestFormSet(BaseFormSet):
return
emails = []
for i in range(0, self.total_form_count()):
form = self.forms[i]
for form in self.forms:
email = form.cleaned_data['email']
if email in emails:
raise ValidationError(