﻿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
1249	[magic-removal][patch] manipulator_validator_unique	the.twentysixth@…	Adrian Holovaty	"self.original_object maybe None (e.g. in the case of AddManipulator)

{{{
Index: django/db/models/fields/__init__.py
===================================================================
--- __init__.py (revision 2051)
+++ __init__.py (working copy)
@@ -32,7 +32,8 @@
         old_obj = self.manager.get_object(**{lookup_type: field_data})
     except ObjectDoesNotExist:
         return
-    if hasattr(self, 'original_object') and self.original_object._get_pk_val() 
== old_obj._get_pk_val():
+    if hasattr(self, 'original_object') and hasattr(self.original_object, '_get
_pk_val') and \
+           self.original_object._get_pk_val() == old_obj._get_pk_val():
         return
     raise validators.ValidationError, _(""%(optname)s with this %(fieldname)s al
ready exists."") % {'optname': capfirst(opts.verbose_name), 'fieldname': f.verbos
e_name}
}}}"	defect	closed	Validators		normal	fixed			Unreviewed	1	0	0	0	0	0
