fixed a bug that prevented the unique validation to work

git-svn-id: http://code.djangoproject.com/svn/django/trunk@1329 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Georg Bauer 2005-11-21 11:09:36 +00:00
parent e4e28d907a
commit 7b201f6e52
1 changed files with 1 additions and 1 deletions

View File

@ -50,7 +50,7 @@ def manipulator_validator_unique(f, opts, self, field_data, all_data):
if f.rel and isinstance(f.rel, ManyToOne): if f.rel and isinstance(f.rel, ManyToOne):
lookup_type = '%s__%s__exact' % (f.name, f.rel.get_related_field().name) lookup_type = '%s__%s__exact' % (f.name, f.rel.get_related_field().name)
else: else:
lookup_type = '%s__exact' % (f.name, lookup_type) lookup_type = '%s__exact' % f.name
try: try:
old_obj = opts.get_model_module().get_object(**{lookup_type: field_data}) old_obj = opts.get_model_module().get_object(**{lookup_type: field_data})
except ObjectDoesNotExist: except ObjectDoesNotExist: