diff options
author | Luke Plant <L.Plant.98@cantab.net> | 2010-05-22 18:42:16 +0000 |
---|---|---|
committer | Luke Plant <L.Plant.98@cantab.net> | 2010-05-22 18:42:16 +0000 |
commit | 6b2d6e18338631367c5a61896d872dbe27d2097e (patch) | |
tree | eaba6dda573108819f4b2139a81e1258e8f63569 /django/views | |
parent | 84060a1f7aff712f6fde71884c501b50c9ef3d46 (diff) | |
download | django-6b2d6e18338631367c5a61896d872dbe27d2097e.tar.gz |
Fixed #13590 - Made CSRF failure page styling consistent with Django's default error page styling.
Thanks to alefteris for suggestion.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@13300 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django/views')
-rw-r--r-- | django/views/csrf.py | 30 |
1 files changed, 25 insertions, 5 deletions
diff --git a/django/views/csrf.py b/django/views/csrf.py index aa5e25b5b4..fa996fff24 100644 --- a/django/views/csrf.py +++ b/django/views/csrf.py @@ -11,12 +11,30 @@ CSRF_FAILRE_TEMPLATE = """ <html lang="en"> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8"> + <meta name="robots" content="NONE,NOARCHIVE"> <title>403 Forbidden</title> + <style type="text/css"> + html * { padding:0; margin:0; } + body * { padding:10px 20px; } + body * * { padding:0; } + body { font:small sans-serif; background:#eee; } + body>div { border-bottom:1px solid #ddd; } + h1 { font-weight:normal; margin-bottom:.4em; } + h1 span { font-size:60%; color:#666; font-weight:normal; } + #info { background:#f6f6f6; } + #info ul { margin: 0.5em 4em; } + #info p { padding-top:10px; } + #summary { background: #ffc; } + #explanation { background:#eee; border-bottom: 0px none; } + </style> </head> <body> - <h1>403 Forbidden</h1> +<div id="summary"> + <h1>Forbidden <span>(403)</span></h1> <p>CSRF verification failed. Request aborted.</p> - {% if DEBUG %} +</div> +{% if DEBUG %} +<div id="info"> <h2>Help</h2> {% if reason %} <p>Reason given for failure:</p> @@ -51,10 +69,12 @@ CSRF_FAILRE_TEMPLATE = """ and only the initial error message will be displayed. </p> <p>You can customize this page using the CSRF_FAILURE_VIEW setting.</p> - {% else %} +</div> +{% else %} +<div id="explanation"> <p><small>More information is available with DEBUG=True.</small></p> - - {% endif %} +</div> +{% endif %} </body> </html> """ |