hopefully fixes C3NAV-37C3-J
This commit is contained in:
parent
09741b9cee
commit
7d11c88b01
1 changed files with 16 additions and 6 deletions
|
@ -217,13 +217,23 @@ def changeset_detail(request, pk):
|
||||||
continue
|
continue
|
||||||
|
|
||||||
for pk, changed_object in changed_objects.items():
|
for pk, changed_object in changed_objects.items():
|
||||||
obj = objects[model][pk]
|
if pk in objects[model]:
|
||||||
|
obj = objects[model][pk]
|
||||||
obj_desc = format_lazy(_('{model} #{id}'), model=obj.__class__._meta.verbose_name, id=pk)
|
obj_desc = format_lazy(_('{model} #{id}'), model=obj.__class__._meta.verbose_name, id=pk)
|
||||||
if is_created_pk(pk):
|
if is_created_pk(pk):
|
||||||
obj_still_exists = pk in changeset.created_objects.get(obj.__class__, ())
|
obj_still_exists = pk in changeset.created_objects.get(obj.__class__, ())
|
||||||
|
else:
|
||||||
|
obj_still_exists = pk not in changeset.deleted_existing.get(obj.__class__, ())
|
||||||
else:
|
else:
|
||||||
obj_still_exists = pk not in changeset.deleted_existing.get(obj.__class__, ())
|
obj = changed_object.obj._obj
|
||||||
|
obj_still_exists = False
|
||||||
|
if changed_object.deleted:
|
||||||
|
obj_desc = format_lazy(_('{model} #{id}'), model=obj.__class__._meta.verbose_name, id=pk)
|
||||||
|
|
||||||
|
else:
|
||||||
|
obj_desc = format_lazy(_('{model} #{id} (deleted outside this changeset)'),
|
||||||
|
model=obj.__class__._meta.verbose_name, id=pk)
|
||||||
|
|
||||||
|
|
||||||
edit_url = None
|
edit_url = None
|
||||||
if obj_still_exists and can_edit and not isinstance(obj, LocationRedirect):
|
if obj_still_exists and can_edit and not isinstance(obj, LocationRedirect):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue