Skip to content
Snippets Groups Projects
Commit 1d2090a4 authored by Renaud Boyer's avatar Renaud Boyer Committed by Renaud Boyer
Browse files

Handle snapshot missing root directory in staging

parent 785899b7
No related tags found
No related merge requests found
Pipeline #12984 failed
......@@ -238,9 +238,10 @@ def _get_content_from_request(request: HttpRequest) -> Dict[str, Any]:
browse_context="content",
visit_type=request.GET.get("visit_type"),
)
root_directory = snapshot_context["root_directory"]
assert root_directory is not None # to keep mypy happy
return archive.lookup_directory_with_path(root_directory, path)
if root_directory := snapshot_context["root_directory"]:
return archive.lookup_directory_with_path(root_directory, path)
# this should only happen in staging due to a partial storage
raise NotFoundExc(f"Missing root directory for {snapshot}")
@browse_route(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment