Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
S
swh-web
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Renaud Boyer
swh-web
Commits
1d2090a4
Commit
1d2090a4
authored
2 months ago
by
Renaud Boyer
Committed by
Renaud Boyer
1 month ago
Browse files
Options
Downloads
Patches
Plain Diff
Handle snapshot missing root directory in staging
parent
785899b7
Branches
missing-root-dir-404
No related tags found
No related merge requests found
Pipeline
#12984
failed
1 month ago
Stage: external
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
swh/web/browse/views/content.py
+4
-3
4 additions, 3 deletions
swh/web/browse/views/content.py
with
4 additions
and
3 deletions
swh/web/browse/views/content.py
+
4
−
3
View file @
1d2090a4
...
...
@@ -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
(
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment