diff --git a/src/documents/data_models.py b/src/documents/data_models.py index 9257e9f57..22572709f 100644 --- a/src/documents/data_models.py +++ b/src/documents/data_models.py @@ -124,10 +124,14 @@ class DocumentMetadataOverrides: attach_perms=True, ) overrides.view_groups = [ - group.id for group, perms in groups_with_perms if "view_document" in perms + group.id + for group in groups_with_perms + if "view_document" in groups_with_perms[group] ] overrides.change_groups = [ - group.id for group, perms in groups_with_perms if "change_document" in perms + group.id + for group in groups_with_perms + if "change_document" in groups_with_perms[group] ] return overrides