• Raphaël Hertzog's avatar
    Avoid traceback generated with unexpected URL like /e/extend/index.html · e3a4d88b
    Raphaël Hertzog authored
    The code is only ready to deal with /<hash>/<sourcepackage>.html and the
    presence of a supplementary slash caused this exception:
    
    NoReverseMatch at /e/extend/index.html
    Reverse for 'dtracker-package-page' with keyword arguments '{'package_name': 'extend/index'}' not found.
    1 pattern(s) tried: ['pkg/(?P<package_name>[^/]+)/?$']
    
    Traceback:
    File "/usr/lib/python3/dist-packages/django/core/handlers/exception.py" in inner
      41.             response = get_response(request)
    File "/usr/lib/python3/dist-packages/django/core/handlers/base.py" in _get_response
      187.                 response = self.process_exception_by_middleware(e, request)
    File "/usr/lib/python3/dist-packages/django/core/handlers/base.py" in _get_response
      185.                 response = wrapped_callback(request, *callback_args, **callback_kwargs)
    File "/srv/tracker.debian.org/distro-tracker/distro_tracker/core/views.py" in legacy_package_url_redirect
      96.                     permanent=True)
    File "/usr/lib/python3/dist-packages/django/shortcuts.py" in redirect
      56.     return redirect_class(resolve_url(to, *args, **kwargs))
    File "/usr/lib/python3/dist-packages/django/shortcuts.py" in resolve_url
      147.         return reverse(to, args=args, kwargs=kwargs)
    File "/usr/lib/python3/dist-packages/django/urls/base.py" in reverse
      91.     return force_text(iri_to_uri(resolver._reverse_with_prefix(view, prefix, *args, **kwargs)))
    File "/usr/lib/python3/dist-packages/django/urls/resolvers.py" in _reverse_with_prefix
      497.         raise NoReverseMatch(msg)
    e3a4d88b
Name
Last commit
Last update
bin Loading commit data...
data Loading commit data...
debian Loading commit data...
distro_tracker Loading commit data...
django_email_accounts Loading commit data...
docs Loading commit data...
functional_tests Loading commit data...
.coveragerc Loading commit data...
.gitignore Loading commit data...
.gitlab-ci.yml Loading commit data...
COPYRIGHT Loading commit data...
LICENSE Loading commit data...
MANIFEST.in Loading commit data...
README.md Loading commit data...
TODO Loading commit data...
manage.py Loading commit data...
setup.py Loading commit data...
tox.ini Loading commit data...