diff --git a/src/c3nav/editor/models/changeset.py b/src/c3nav/editor/models/changeset.py index 39f68096..c9be5750 100644 --- a/src/c3nav/editor/models/changeset.py +++ b/src/c3nav/editor/models/changeset.py @@ -343,8 +343,9 @@ class ChangeSet(models.Model): except FieldDoesNotExist: # todo: fix this continue - objects.setdefault(LocationSlug, {})[target.pk] = target._obj - objects.setdefault(target.__class__, {})[target.pk] = target._obj + # todo: why is it sometimes wrapped and sometimes not? + objects.setdefault(LocationSlug, {})[target.pk] = getattr(target, '_obj', target) + objects.setdefault(target.__class__, {})[target.pk] = getattr(target, '_obj', target) return objects