From 21720064bb97feffad4e8587ccd10c3a445f5411 Mon Sep 17 00:00:00 2001 From: SilviaAmAm Date: Wed, 16 Oct 2024 13:31:32 +0200 Subject: [PATCH] :sparkles: [#397] Delete local zaak metadata --- backend/src/openarchiefbeheer/destruction/models.py | 3 +++ backend/src/openarchiefbeheer/destruction/tasks.py | 1 + 2 files changed, 4 insertions(+) diff --git a/backend/src/openarchiefbeheer/destruction/models.py b/backend/src/openarchiefbeheer/destruction/models.py index 774046cb..ca9a4581 100644 --- a/backend/src/openarchiefbeheer/destruction/models.py +++ b/backend/src/openarchiefbeheer/destruction/models.py @@ -277,6 +277,9 @@ def create_report_zaak(self) -> None: attach_report_to_zaak(destruction_list, store) + def clear_local_metadata(self) -> None: + self.items.filter(status=ListItemStatus.suggested).update(extra_zaak_data={}) + class DestructionListItem(models.Model): destruction_list = models.ForeignKey( diff --git a/backend/src/openarchiefbeheer/destruction/tasks.py b/backend/src/openarchiefbeheer/destruction/tasks.py index cc3e4d01..9d84b571 100644 --- a/backend/src/openarchiefbeheer/destruction/tasks.py +++ b/backend/src/openarchiefbeheer/destruction/tasks.py @@ -123,6 +123,7 @@ def complete_and_notify(pk: int) -> None: destruction_list.generate_destruction_report() destruction_list.create_report_zaak() + destruction_list.clear_local_metadata() destruction_list.processing_status = InternalStatus.succeeded destruction_list.save()