Skip to content
Browse files

magic-removal: Fixed #1249 -- Fixed bug in manipulator_validator_unique

git-svn-id: bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
1 parent 32cf0aa commit ee1a1eb5192cd840c60b707e3a1421c33ddc8132 @adrianholovaty adrianholovaty committed
Showing with 1 addition and 1 deletion.
  1. +1 −1 django/db/models/fields/
2 django/db/models/fields/
@@ -32,7 +32,7 @@ def manipulator_validator_unique(f, opts, self, field_data, all_data):
old_obj = self.manager.get_object(**{lookup_type: field_data})
except ObjectDoesNotExist:
- if hasattr(self, 'original_object') and self.original_object._get_pk_val() == old_obj._get_pk_val():
+ if getattr(self, 'original_object', None) and self.original_object._get_pk_val() == old_obj._get_pk_val():
raise validators.ValidationError, _("%(optname)s with this %(fieldname)s already exists.") % {'optname': capfirst(opts.verbose_name), 'fieldname': f.verbose_name}

0 comments on commit ee1a1eb

Please sign in to comment.
Something went wrong with that request. Please try again.