Fixed #275 -- Bug in validators.RequiredIfOtherFieldsGiven. Thanks, jhernandez

git-svn-id: http://code.djangoproject.com/svn/django/trunk@410 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Adrian Holovaty 2005-08-05 15:41:58 +00:00
parent 0b9330b085
commit 888cf1f889
1 changed files with 1 additions and 1 deletions

View File

@ -237,7 +237,7 @@ class RequiredIfOtherFieldsGiven:
def __call__(self, field_data, all_data): def __call__(self, field_data, all_data):
for field in self.other: for field in self.other:
if all_data.get(field) and not field_data: if all_data.get(field, False) and not field_data:
raise ValidationError, self.error_message raise ValidationError, self.error_message
class RequiredIfOtherFieldGiven(RequiredIfOtherFieldsGiven): class RequiredIfOtherFieldGiven(RequiredIfOtherFieldsGiven):