NoReverseMatch: Reverse for 'browse-snapshot-branches' with keyword arguments '{'snapshot_id': 'swh:1:dir:af015f4...
Sentry Issue: SWH-WEBAPP-598
NoReverseMatch: Reverse for 'browse-snapshot-branches' with keyword arguments '{'snapshot_id': 'swh:1:dir:af015f40a0ce97937eff7e79dd4b6ae11234146f'}' not found. 2 pattern(s) tried: ['browse/snapshot/branches/$', 'browse/snapshot/(?P<snapshot_id>[0-9a-f]+)/branches/$']
File "django/core/handlers/base.py", line 113, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "swh/web/browse/views/snapshot.py", line 191, in snapshot_branches_browse
query_params=request.GET,
File "swh/web/utils/__init__.py", line 94, in reverse
viewname, urlconf=urlconf, kwargs=url_args, current_app=current_app
File "django/urls/base.py", line 90, in reverse
return iri_to_uri(resolver._reverse_with_prefix(view, prefix, *args, **kwargs))
File "django/urls/resolvers.py", line 673, in _reverse_with_prefix
raise NoReverseMatch(msg)
This happens when visiting https://archive.softwareheritage.org/browse/snapshot/branches/?snapshot=swh:1:dir:af015f40a0ce97937eff7e79dd4b6ae11234146f because swh:1:dir:af015f40a0ce97937eff7e79dd4b6ae11234146f
is a SWHID (and even a directory SWHID), instead of a snapshot id.
This should be a 400 or 404 error instead