diff --git a/swh/web/browse/views/snapshot.py b/swh/web/browse/views/snapshot.py --- a/swh/web/browse/views/snapshot.py +++ b/swh/web/browse/views/snapshot.py @@ -16,21 +16,22 @@ ) -@browse_route(r'snapshot/(?P[0-9a-f]+)/', +@browse_route(r'snapshot/(?P[0-9a-fA-F]+)/', view_name='browse-snapshot') def snapshot_browse(request, snapshot_id): """Django view for browsing the content of a snapshot. The url that points to it is :http:get:`/browse/snapshot/(snapshot_id)/` """ + snapshot_id = snapshot_id.lower() browse_snapshot_url = reverse('browse-snapshot-directory', url_args={'snapshot_id': snapshot_id}, query_params=request.GET) return redirect(browse_snapshot_url) -@browse_route(r'snapshot/(?P[0-9a-f]+)/directory/', - r'snapshot/(?P[0-9a-f]+)/directory/(?P.+)/', +@browse_route(r'snapshot/(?P[0-9a-fA-F]+)/directory/', + r'snapshot/(?P[0-9a-fA-F]+)/directory/(?P.+)/', view_name='browse-snapshot-directory') def snapshot_directory_browse(request, snapshot_id, path=None): """Django view for browsing the content of a directory collected @@ -38,6 +39,7 @@ The url that points to it is :http:get:`/browse/snapshot/(snapshot_id)/directory/[(path)/]` """ # noqa + snapshot_id = snapshot_id.lower() origin_type = request.GET.get('origin_type', None) origin_url = request.GET.get('origin_url', None) if not origin_url: @@ -47,7 +49,7 @@ origin_url=origin_url) -@browse_route(r'snapshot/(?P[0-9a-f]+)/content/(?P.+)/', +@browse_route(r'snapshot/(?P[0-9a-fA-F]+)/content/(?P.+)/', view_name='browse-snapshot-content') def snapshot_content_browse(request, snapshot_id, path): """Django view that produces an HTML display of a content @@ -55,10 +57,11 @@ The url that points to it is :http:get:`/browse/snapshot/(snapshot_id)/content/(path)/` """ # noqa + snapshot_id = snapshot_id.lower() return browse_snapshot_content(request, snapshot_id=snapshot_id, path=path) -@browse_route(r'snapshot/(?P[0-9a-f]+)/log/', +@browse_route(r'snapshot/(?P[0-9a-fA-F]+)/log/', view_name='browse-snapshot-log') def snapshot_log_browse(request, snapshot_id): """Django view that produces an HTML display of revisions history (aka @@ -66,10 +69,11 @@ The url that points to it is :http:get:`/browse/snapshot/(snapshot_id)/log/` """ # noqa + snapshot_id = snapshot_id.lower() return browse_snapshot_log(request, snapshot_id=snapshot_id) -@browse_route(r'snapshot/(?P[0-9a-f]+)/branches/', +@browse_route(r'snapshot/(?P[0-9a-fA-F]+)/branches/', view_name='browse-snapshot-branches') def snapshot_branches_browse(request, snapshot_id): """Django view that produces an HTML display of the list of releases @@ -77,10 +81,11 @@ The url that points to it is :http:get:`/browse/snapshot/(snapshot_id)/branches/` """ # noqa + snapshot_id = snapshot_id.lower() return browse_snapshot_branches(request, snapshot_id=snapshot_id) -@browse_route(r'snapshot/(?P[0-9a-f]+)/releases/', +@browse_route(r'snapshot/(?P[0-9a-fA-F]+)/releases/', view_name='browse-snapshot-releases') def snapshot_releases_browse(request, snapshot_id): """Django view that produces an HTML display of the list of releases @@ -88,4 +93,5 @@ The url that points to it is :http:get:`/browse/snapshot/(snapshot_id)/releases/` """ # noqa + snapshot_id = snapshot_id.lower() return browse_snapshot_releases(request, snapshot_id=snapshot_id)