summaryrefslogtreecommitdiff
path: root/archaeological_warehouse/management/commands/migrate_to_new_container_management.py
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2020-12-23 08:48:56 +0100
committerÉtienne Loks <etienne.loks@iggdrasil.net>2021-02-28 12:15:23 +0100
commita91c54dbb338a075a2dbf2e9ddc2d4acff225f2e (patch)
treec87061a9c41e9ff76fb25526a34c764e59985b38 /archaeological_warehouse/management/commands/migrate_to_new_container_management.py
parentb9579090f654eed8fc9ff656cfd415327f890e6a (diff)
downloadIshtar-a91c54dbb338a075a2dbf2e9ddc2d4acff225f2e.tar.bz2
Ishtar-a91c54dbb338a075a2dbf2e9ddc2d4acff225f2e.zip
Container: fix index generation
Diffstat (limited to 'archaeological_warehouse/management/commands/migrate_to_new_container_management.py')
-rw-r--r--archaeological_warehouse/management/commands/migrate_to_new_container_management.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/archaeological_warehouse/management/commands/migrate_to_new_container_management.py b/archaeological_warehouse/management/commands/migrate_to_new_container_management.py
index 44895ce69..24ec078bf 100644
--- a/archaeological_warehouse/management/commands/migrate_to_new_container_management.py
+++ b/archaeological_warehouse/management/commands/migrate_to_new_container_management.py
@@ -58,7 +58,10 @@ class Command(BaseCommand):
for idx, container in enumerate(to_update.values("id").all()):
sys.stdout.write("* Updating: {}/{}\r".format(idx + 1, to_be_done))
sys.stdout.flush()
- container = models.Container.objects.get(pk=container["id"])
+ try:
+ container = models.Container.objects.get(pk=container["id"])
+ except models.Container.DoesNotExist:
+ continue # already merged
if container.responsible_id not in potential_duplicate:
potential_duplicate[container.responsible_id] = {}
parent = None