Skip to content

Commit 31333d3

Browse files
committed
devel: logout is a POST only action since Django 5.0
We can no longer logout with a GET and as folks probably don't want to depend on JavaScript for logging out, add a form and style the input as an anchor to make POST'ing work. Closes: #511
1 parent f8995eb commit 31333d3

File tree

2 files changed

+26
-1
lines changed

2 files changed

+26
-1
lines changed

sitestatic/archweb.css

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1197,3 +1197,24 @@ ul.signoff-list {
11971197
.pgp-key-ids {
11981198
display: inline-block;
11991199
}
1200+
1201+
.logout-form {
1202+
display: inline-block;
1203+
1204+
/* style input as a normal anchor */
1205+
input {
1206+
background: none!important;
1207+
border: none;
1208+
padding: 0!important;
1209+
/*optional*/
1210+
font-family: arial, sans-serif;
1211+
font-size: 0.9em;
1212+
/*input has OS specific font-family*/
1213+
color: #07b;
1214+
}
1215+
1216+
input:hover {
1217+
text-decoration: underline;
1218+
cursor: pointer;
1219+
}
1220+
}

templates/base.html

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,11 @@
5555
{% if user|in_groups:'Developers:Package Maintainers:Support Staff' %}
5656
<li><a href="/devel/tier0mirror/" title="Your Tier 0 Mirror information">Tier0 mirror</a></li>
5757
{% endif %}
58-
<li><a href="/logout/" title="Logout of the developer interface">Logout</a></li>
58+
<li>
59+
<form class="logout-form" method="post" action="/logout/">{% csrf_token %}
60+
<input type="submit" title="Logout of the developer interface" value="Logout"/>
61+
</form>
62+
</li>
5963
</ul>
6064
{% endif %}
6165
</div>

0 commit comments

Comments
 (0)