From 0cd5af91a0719756373a197767616c7e0b11e1ff Mon Sep 17 00:00:00 2001 From: shamoon <4887959+shamoon@users.noreply.github.com> Date: Sat, 6 Apr 2024 06:42:15 -0700 Subject: [PATCH] Fix: Use list for overrides users properties --- src/documents/data_models.py | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/src/documents/data_models.py b/src/documents/data_models.py index 4922b72dd..9257e9f57 100644 --- a/src/documents/data_models.py +++ b/src/documents/data_models.py @@ -103,14 +103,18 @@ class DocumentMetadataOverrides: overrides.owner_id = doc.owner.id if doc.owner else None overrides.tag_ids = list(doc.tags.values_list("id", flat=True)) - overrides.view_users = get_users_with_perms( - doc, - only_with_perms_in=["view_document"], - ).values_list("id", flat=True) - overrides.change_users = get_users_with_perms( - doc, - only_with_perms_in=["change_document"], - ).values_list("id", flat=True) + overrides.view_users = list( + get_users_with_perms( + doc, + only_with_perms_in=["view_document"], + ).values_list("id", flat=True), + ) + overrides.change_users = list( + get_users_with_perms( + doc, + only_with_perms_in=["change_document"], + ).values_list("id", flat=True), + ) overrides.custom_field_ids = list( doc.custom_fields.values_list("id", flat=True), )