Skip to content

Fix /404/ testing page #3976

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 24, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions readthedocs/core/views/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,14 @@ def server_error_500(request, template_name='500.html'):
return r


def server_error_404(request, exception, template_name='404.html'): # pylint: disable=unused-argument # noqa
"""A simple 404 handler so we get media."""
def server_error_404(request, exception=None, template_name='404.html'): # pylint: disable=unused-argument # noqa
"""
A simple 404 handler so we get media.

.. note::

Marking exception as optional to make /404/ testing page to work.
"""
response = get_redirect_response(request, path=request.get_full_path())
if response:
return response
Expand Down