Changeset View
Changeset View
Standalone View
Standalone View
swh/web/browse/views/content.py
Show First 20 Lines • Show All 172 Lines • ▼ Show 20 Lines | |||||
def _get_content_from_request(request): | def _get_content_from_request(request): | ||||
path = request.GET.get("path") | path = request.GET.get("path") | ||||
if path is None: | if path is None: | ||||
raise BadInputExc("The path query parameter must be provided.") | raise BadInputExc("The path query parameter must be provided.") | ||||
snapshot = request.GET.get("snapshot") or request.GET.get("snapshot_id") | snapshot = request.GET.get("snapshot") or request.GET.get("snapshot_id") | ||||
origin_url = request.GET.get("origin_url") | origin_url = request.GET.get("origin_url") | ||||
if snapshot is None and origin_url is None: | if snapshot is None and origin_url is None: | ||||
raise BadInputExc( | raise BadInputExc( | ||||
"The origin_url or snapshot query parameters must be provided." | "The origin_url or snapshot query parameter must be provided." | ||||
) | ) | ||||
snapshot_context = get_snapshot_context( | snapshot_context = get_snapshot_context( | ||||
snapshot_id=snapshot, | snapshot_id=snapshot, | ||||
origin_url=origin_url, | origin_url=origin_url, | ||||
path=path, | path=path, | ||||
timestamp=request.GET.get("timestamp"), | timestamp=request.GET.get("timestamp"), | ||||
visit_id=request.GET.get("visit_id"), | visit_id=request.GET.get("visit_id"), | ||||
branch_name=request.GET.get("branch"), | branch_name=request.GET.get("branch"), | ||||
▲ Show 20 Lines • Show All 255 Lines • Show Last 20 Lines |