Changeset View
Changeset View
Standalone View
Standalone View
swh/web/browse/views/snapshot.py
Show All 38 Lines | |||||
def snapshot_browse(request: HttpRequest, snapshot_id: str) -> HttpResponse: | def snapshot_browse(request: HttpRequest, snapshot_id: str) -> HttpResponse: | ||||
"""Django view for browsing the content of a snapshot. | """Django view for browsing the content of a snapshot. | ||||
The url that points to it is :http:get:`/browse/snapshot/(snapshot_id)/` | The url that points to it is :http:get:`/browse/snapshot/(snapshot_id)/` | ||||
""" | """ | ||||
browse_snapshot_url = reverse( | browse_snapshot_url = reverse( | ||||
"browse-snapshot-directory", | "browse-snapshot-directory", | ||||
url_args={"snapshot_id": snapshot_id}, | url_args={"snapshot_id": snapshot_id}, | ||||
query_params=request.GET, | query_params=request.GET.dict(), | ||||
) | ) | ||||
return redirect(browse_snapshot_url) | return redirect(browse_snapshot_url) | ||||
@browse_route( | @browse_route( | ||||
r"snapshot/(?P<snapshot_id>[0-9a-f]+)/directory/", | r"snapshot/(?P<snapshot_id>[0-9a-f]+)/directory/", | ||||
view_name="browse-snapshot-directory", | view_name="browse-snapshot-directory", | ||||
checksum_args=["snapshot_id"], | checksum_args=["snapshot_id"], | ||||
▲ Show 20 Lines • Show All 182 Lines • Show Last 20 Lines |