Skip to content

Commit

Permalink
Fixed #275 -- Bug in validators.RequiredIfOtherFieldsGiven. Thanks, j…
Browse files Browse the repository at this point in the history
…hernandez

git-svn-id: http://code.djangoproject.com/svn/django/trunk@410 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information
adrianholovaty committed Aug 5, 2005
1 parent 0b9330b commit 888cf1f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion django/core/validators.py
Expand Up @@ -237,7 +237,7 @@ def __init__(self, other_field_names, error_message="Please enter both fields or


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):
Expand Down

0 comments on commit 888cf1f

Please sign in to comment.