summaryrefslogtreecommitdiff
path: root/archaeological_warehouse/management
diff options
context:
space:
mode:
Diffstat (limited to 'archaeological_warehouse/management')
-rw-r--r--archaeological_warehouse/management/commands/migrate_to_new_container_management.py7
1 files changed, 5 insertions, 2 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 24ec078bf..38cabd842 100644
--- a/archaeological_warehouse/management/commands/migrate_to_new_container_management.py
+++ b/archaeological_warehouse/management/commands/migrate_to_new_container_management.py
@@ -76,8 +76,8 @@ class Command(BaseCommand):
parent=parent,
container_type=container_types[
division.division.division_id],
- location=container.responsible,
- responsible=container.responsible)
+ location=container.location,
+ responsible=container.location)
if created:
created_nb += 1
ref = "{} || {}".format(str(new_container.container_type),
@@ -89,6 +89,9 @@ class Command(BaseCommand):
potential_duplicate[container.responsible_id][
ref].append(division.reference.strip())
parent = new_container
+ if container.collection_id != container.responsible_id:
+ container.collection_id = container.responsible_id
+ container.save()
if parent:
q = models.Container.objects.filter(
location=container.location,