Changeset View
Changeset View
Standalone View
Standalone View
swh/web/browse/identifiers.py
Show All 9 Lines | |||||
def swhid_browse(request: HttpRequest, swhid: str) -> HttpResponse: | def swhid_browse(request: HttpRequest, swhid: str) -> HttpResponse: | ||||
""" | """ | ||||
Django view enabling to browse the archive using :ref:`persistent-identifiers`. | Django view enabling to browse the archive using :ref:`persistent-identifiers`. | ||||
The url that points to it is :http:get:`/(swhid)/`. | The url that points to it is :http:get:`/(swhid)/`. | ||||
""" | """ | ||||
swhid_resolved = resolve_swhid(swhid, query_params=request.GET) | swhid_resolved = resolve_swhid(swhid, query_params=request.GET.dict()) | ||||
assert swhid_resolved["browse_url"] | assert swhid_resolved["browse_url"] | ||||
return redirect(swhid_resolved["browse_url"]) | return redirect(swhid_resolved["browse_url"]) |