Skip to content

Commit 239711a

Browse files
committed
fix: thumbnail_only check in update operation
1 parent c92e8f0 commit 239711a

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

ayon_server/operations/project_level/entity_update.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,10 @@ async def update_project_level_entity(
106106
assert operation.data is not None, "data is required for update"
107107
assert operation.entity_id is not None, "entity_id is required for update"
108108

109+
# We use slightly different ACL logic if only the thumbnail_id is being updated.
110+
thumbnail_only = len(operation.data) == 1 and (
111+
"thumbnailId" in operation.data or "thumbnail_id" in operation.data
112+
)
109113
entity = await entity_class.load(project_name, operation.entity_id)
110114

111115
hooks = OperationHooks.hooks()
@@ -128,10 +132,6 @@ async def update_project_level_entity(
128132

129133
update_payload_dict = payload.dict(exclude_unset=True, by_alias=False)
130134

131-
# We use slightly different ACL logic if only the thumbnail_id is being updated.
132-
133-
thumbnail_only = len(operation.data) == 1 and "thumbnail_id" in update_payload_dict
134-
135135
if user:
136136
await entity.ensure_update_access(user, thumbnail_only=thumbnail_only)
137137

0 commit comments

Comments
 (0)