summaryrefslogtreecommitdiff
path: root/archaeological_warehouse/management/commands
diff options
context:
space:
mode:
Diffstat (limited to 'archaeological_warehouse/management/commands')
-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