Browse files

Fixed bug in manipulator_valid_rel_key() -- it assumed the related ob…

…ject's primary key was called 'id'

git-svn-id: http://code.djangoproject.com/svn/django/trunk@530 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
1 parent b1d9682 commit f5ab1320ed3acbbc8b8bc358a46f5ae1380deff9 @adrianholovaty adrianholovaty committed Aug 17, 2005
Showing with 1 addition and 1 deletion.
  1. +1 −1 django/core/meta/fields.py
View
2 django/core/meta/fields.py
@@ -30,7 +30,7 @@ def manipulator_valid_rel_key(f, self, field_data, all_data):
"Validates that the value is a valid foreign key"
mod = f.rel.to.get_model_module()
try:
- mod.get_object(**{'id__iexact': field_data})
+ mod.get_object(pk=field_data)
except ObjectDoesNotExist:
raise validators.ValidationError, "Please enter a valid %s." % f.verbose_name

0 comments on commit f5ab132

Please sign in to comment.