From 5fd3b5341c4a8c7db6f733258b25d7de64c89791 Mon Sep 17 00:00:00 2001 From: 0einstein0 Date: Thu, 8 Aug 2024 16:37:00 +0200 Subject: [PATCH] files: sync file access status --- .../records/systemfields/files/manager.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/invenio_records_resources/records/systemfields/files/manager.py b/invenio_records_resources/records/systemfields/files/manager.py index 60673816..cfee538e 100644 --- a/invenio_records_resources/records/systemfields/files/manager.py +++ b/invenio_records_resources/records/systemfields/files/manager.py @@ -367,11 +367,14 @@ def sync(self, src_files, delete_extras=True): else: self[f_key] = obj_or_key - # Check for metadata changes + # Check for metadata and access changes for key, dest_rf in self.entries.items(): if key in src_files: src_rf = src_files[key] - if src_rf.metadata != dest_rf.metadata: + if ( + src_rf.metadata != dest_rf.metadata + or src_rf.access != dest_rf.access + ): obj_or_key = dest_rf.object_version self[key] = obj_or_key, dict(src_rf)