Skip to content

Commit

Permalink
Merge branch 'bugfix/empty-sharing-id-cache-500' into 'devel'
Browse files Browse the repository at this point in the history
Bugfix/empty sharing id cache 500

See merge request sds-dev/sd-connect/swift-browser-ui!138
  • Loading branch information
mradavi committed Aug 15, 2023
2 parents d7efca4 + c4793a7 commit edc0409
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
15 changes: 9 additions & 6 deletions swift_browser_ui/sharing/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,12 +214,15 @@ async def handle_get_id_cache(request: aiohttp.web.Request) -> aiohttp.web.Respo

# Try with key as name
ret = await request.app["db_conn"].match_name_id(key)
return aiohttp.web.json_response(
{
"id": ret[0]["id"],
"name": ret[0]["name"],
}
)
if ret:
return aiohttp.web.json_response(
{
"id": ret[0]["id"],
"name": ret[0]["name"],
}
)

return aiohttp.web.HTTPNotFound()


async def handle_health_check(request: aiohttp.web.Request) -> aiohttp.web.Response:
Expand Down
3 changes: 3 additions & 0 deletions swift_browser_ui/sharing/db.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,9 @@ async def get_access_container_details(
user,
)

if query is None:
return {}

access = []

if query["r_read"]:
Expand Down

0 comments on commit edc0409

Please sign in to comment.