Fix: Use list for overrides users properties

This commit is contained in:
shamoon 2024-04-06 06:42:15 -07:00
parent c4a9697e02
commit 0cd5af91a0

View File

@ -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(
overrides.view_users = list(
get_users_with_perms(
doc,
only_with_perms_in=["view_document"],
).values_list("id", flat=True)
overrides.change_users = get_users_with_perms(
).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)
).values_list("id", flat=True),
)
overrides.custom_field_ids = list(
doc.custom_fields.values_list("id", flat=True),
)