mirror of
https://github.com/django/django.git
synced 2025-06-05 03:29:12 +00:00
magic-removal: Fixed #1313 -- Bugfixes for magic-removal. Thanks, jpaulofarias
git-svn-id: http://code.djangoproject.com/svn/django/branches/magic-removal@2218 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
171c1a5a06
commit
52b2dd620f
@ -9,7 +9,7 @@ DELETION = 3
|
|||||||
|
|
||||||
class LogEntryManager(models.Manager):
|
class LogEntryManager(models.Manager):
|
||||||
def log_action(self, user_id, content_type_id, object_id, object_repr, action_flag, change_message=''):
|
def log_action(self, user_id, content_type_id, object_id, object_repr, action_flag, change_message=''):
|
||||||
e = self.klass(None, None, user_id, content_type_id, object_id, object_repr[:200], action_flag, change_message)
|
e = self.model(None, None, user_id, content_type_id, object_id, object_repr[:200], action_flag, change_message)
|
||||||
e.save()
|
e.save()
|
||||||
|
|
||||||
class LogEntry(models.Model):
|
class LogEntry(models.Model):
|
||||||
|
@ -32,7 +32,7 @@ def manipulator_validator_unique(f, opts, self, field_data, all_data):
|
|||||||
"Validates that the value is unique for this field."
|
"Validates that the value is unique for this field."
|
||||||
lookup_type = f.get_validator_unique_lookup_type()
|
lookup_type = f.get_validator_unique_lookup_type()
|
||||||
try:
|
try:
|
||||||
old_obj = self.manager.get_object(**{lookup_type: field_data})
|
old_obj = self.manager.get(**{lookup_type: field_data})
|
||||||
except ObjectDoesNotExist:
|
except ObjectDoesNotExist:
|
||||||
return
|
return
|
||||||
if getattr(self, 'original_object', None) 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():
|
||||||
|
Loading…
x
Reference in New Issue
Block a user