mirror of
https://github.com/django/django.git
synced 2024-12-26 11:06:07 +00:00
Fixed bug in manipulator_valid_rel_key() -- it assumed the related object's primary key was called 'id'
git-svn-id: http://code.djangoproject.com/svn/django/trunk@530 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
b1d9682a38
commit
f5ab1320ed
@ -30,7 +30,7 @@ def manipulator_valid_rel_key(f, self, field_data, all_data):
|
|||||||
"Validates that the value is a valid foreign key"
|
"Validates that the value is a valid foreign key"
|
||||||
mod = f.rel.to.get_model_module()
|
mod = f.rel.to.get_model_module()
|
||||||
try:
|
try:
|
||||||
mod.get_object(**{'id__iexact': field_data})
|
mod.get_object(pk=field_data)
|
||||||
except ObjectDoesNotExist:
|
except ObjectDoesNotExist:
|
||||||
raise validators.ValidationError, "Please enter a valid %s." % f.verbose_name
|
raise validators.ValidationError, "Please enter a valid %s." % f.verbose_name
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user