﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
275	Missing arg in django.core.validators.RequiredIfOtherFieldGiven introduced by changeset 403	jhernandez	Adrian Holovaty	"in line 240 of django/core/validators.py the get() method is invoked with less arguments than the required:

In method __call__ of class RequiredIfOtherFieldsGiven :
{{{
def __call__(self, field_data, all_data):
    for field in self.other:
        if all_data.get(field) and not field_data:
           raise ValidationError, self.error_message
}}}
looking at the __call__ method of the class RequiredIfOtherFieldNotGiven, the get() method is invoked in this way:

{{{
if not all_data.get(self.other, False) and not field_data:
}}}

maybe the missed argument is just ``False``, but I'm not sure :-(

This breaks the edit_inline example in tutorial02.

This is the traceback generated when you call ""save"" on the add poll form:

{{{
There's been an error:

Traceback (most recent call last):

  File ""/usr/lib/python2.3/site-packages/django/core/handlers/base.py"", line 63, in get_response
    return callback(request, **param_dict)

  File ""/usr/lib/python2.3/site-packages/django/views/admin/main.py"", line 765, in add_stage
    errors = manipulator.get_validation_errors(new_data)

  File ""/usr/lib/python2.3/site-packages/django/core/formfields.py"", line 70, in get_validation_errors
    validator(new_data.get(field.field_name, ''), new_data)

  File ""/usr/lib/python2.3/site-packages/django/core/validators.py"", line 240, in __call__
    if all_data.get(field) and not field_data:

TypeError: get() takes exactly 3 arguments (2 given)
}}}
"	defect	new	Core framework		normal				Unreviewed	0	0	0	0	0	0
