Skip to content

Commit a5a07cf

Browse files
committed
fixe mypy
1 parent c0c10ad commit a5a07cf

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

services/web/server/src/simcore_service_webserver/security/_authz_access_model.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,10 +115,11 @@ async def can(
115115
check = role_access.check[operation]
116116
try:
117117
ok: bool
118-
if inspect.iscoroutinefunction(check):
119-
ok = await check(context)
118+
coro_or_result = check(context)
119+
if inspect.isawaitable(coro_or_result):
120+
ok = await coro_or_result
120121
else:
121-
ok = check(context)
122+
ok = coro_or_result
122123
return ok
123124

124125
except Exception: # pylint: disable=broad-except

0 commit comments

Comments
 (0)