remove old code
This commit is contained in:
parent
ba3a912b6a
commit
2484535214
1 changed files with 1 additions and 8 deletions
|
@ -379,16 +379,9 @@ class ChangeSet(models.Model):
|
||||||
if isinstance(obj, ModelInstanceWrapper):
|
if isinstance(obj, ModelInstanceWrapper):
|
||||||
obj = obj._obj
|
obj = obj._obj
|
||||||
model = type(obj)
|
model = type(obj)
|
||||||
field = model._meta.get_field('titles' if name.startswith('title_') else name)
|
|
||||||
with transaction.atomic():
|
with transaction.atomic():
|
||||||
current_obj = get_current_obj(model, obj.pk)
|
current_obj = get_current_obj(model, obj.pk)
|
||||||
current_value = get_field_value(current_obj, field)
|
current_value = get_field_value(current_obj, name)
|
||||||
try:
|
|
||||||
current_value = getattr(current_obj, field.attname)
|
|
||||||
except AttributeError:
|
|
||||||
current_value = field.to_prep_value(getattr(current_obj, field.name))
|
|
||||||
if name.startswith('title_'):
|
|
||||||
current_value = current_value.get(name[6:], '')
|
|
||||||
|
|
||||||
if current_value != value:
|
if current_value != value:
|
||||||
change = self._add_value('update', obj, name, value, author)
|
change = self._add_value('update', obj, name, value, author)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue