Removed casting to bool just before negation.

This commit is contained in:
Tomasz Wysocki 2014-04-04 09:10:17 +02:00 committed by Tim Graham
parent cd914e31c9
commit 78623d253b
2 changed files with 2 additions and 2 deletions

View File

@ -157,7 +157,7 @@ class BaseForm(object):
Returns True if the form has no errors. Otherwise, False. If errors are Returns True if the form has no errors. Otherwise, False. If errors are
being ignored, returns False. being ignored, returns False.
""" """
return self.is_bound and not bool(self.errors) return self.is_bound and not self.errors
def add_prefix(self, field_name): def add_prefix(self, field_name):
""" """

View File

@ -308,7 +308,7 @@ class BaseFormSet(object):
# should not cause the entire formset to be invalid. # should not cause the entire formset to be invalid.
continue continue
forms_valid &= form.is_valid() forms_valid &= form.is_valid()
return forms_valid and not bool(self.non_form_errors()) return forms_valid and not self.non_form_errors()
def full_clean(self): def full_clean(self):
""" """