8000 Fixed #13590 - Made CSRF failure page styling consistent with Django'… · ddriddle/django@6b2d6e1 · GitHub
[go: up one dir, main page]

Skip to content

Commit 6b2d6e1

Browse files
committed
Fixed django#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
1 parent 84060a1 commit 6b2d6e1

File tree

1 file changed

+25
-5
lines changed

1 file changed

+25
-5
lines changed

django/views/csrf.py

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,30 @@
1111
<html lang="en">
1212
<head>
1313
<meta http-equiv="content-type" content="text/html; charset=utf-8">
14+
<meta name="robots" content="NONE,NOARCHIVE">
1415
<title>403 Forbidden</title>
16+
<style type="text/css">
17+
html * { padding:0; margin:0; }
18+
body * { padding:10px 20px; }
19+
body * * { padding:0; }
20+
body { font:small sans-serif; background:#eee; }
21+
body>div { border-bottom:1px solid #ddd; }
22+
h1 { font-weight:normal; margin-bottom:.4em; }
23+
h1 span { font-size:60%; color:#666; font-weight:normal; }
24+
#info { background:#f6f6f6; }
25+
#info ul { margin: 0.5em 4em; }
26+
#info p { padding-top:10px; }
27+
#summary { background: #ffc; }
28+
#explanation { background:#eee; border-bottom: 0px none; }
29+
</style>
1530
</head>
1631
<body>
17-
<h1>403 Forbidden</h1>
32+
<div id="summary">
33+
<h1>Forbidden <span>(403)</span></h1>
1834
<p>CSRF verification failed. Request aborted.</p>
19-
{% if DEBUG %}
35+
</div>
36+
{% if DEBUG %}
37+
<div id="info">
2038
<h2>Help</h2>
2139
{% if reason %}
2240
<p>Reason given for failure:</p>
@@ -51,10 +69,12 @@
5169
and only the initial error message will be displayed. </p>
5270
5371
<p>You can customize this page using the CSRF_FAILURE_VIEW setting.</p>
54-
{% else %}
72+
</div>
73+
{% else %}
74+
<div id="explanation">
5575
<p><small>More information is available with DEBUG=True.</small></p>
56-
57-
{% endif %}
76+
</div>
77+
{% endif %}
5878
</body>
5979
</html>
6080
"""

0 commit comments

Comments
 (0)
0