Skip to content

Commit

Permalink
Fix the logout link of the admin app #89
Browse files Browse the repository at this point in the history
Signed-off-by: tdruez <tdruez@nexb.com>
  • Loading branch information
tdruez committed May 2, 2024
1 parent 2d76575 commit a5222f7
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 28 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.rst
Expand Up @@ -51,6 +51,9 @@ Release notes
- Show the individual PURL fields in the Package details view.
https://github.com/nexB/dejacode/issues/83

- Fix the logout link of the admin app.
https://github.com/nexB/dejacode/issues/89

### Version 5.0.1

- Improve the stability of the "Check for new Package versions" feature.
Expand Down
11 changes: 0 additions & 11 deletions dejacode/static/css/dejacode_admin.css
Expand Up @@ -25,17 +25,6 @@ body.grp-popup #grp-content { padding-top: 0; top: 0; }
header#grp-header li.nav-header { padding: 4px 10px; color: #808080; }
.user-options-handler { text-align: end; }

#logout-form {
display: inline;
}
#logout-form button {
background: none;
border: none;
cursor: pointer;
padding: 0;
text-decoration: underline;
}

#grp-user-tools>li button {
display: block;
padding: 10px 10px;
Expand Down
4 changes: 3 additions & 1 deletion dje/templates/admin/base_site.html
Expand Up @@ -120,7 +120,9 @@ <h1 id="grp-admin-title">
</li>
{% endif %}
<li>
<a href="{% url 'logout' %}">{% trans 'Sign out' %}</a>
<form id="logout-form" method="post" action="{% url 'admin:logout' %}">{% csrf_token %}
<button type="submit">{% trans 'Sign out' %}</button>
</form>
</li>
</ul>
</li>
Expand Down
2 changes: 1 addition & 1 deletion policy/tests/test_admin.py
Expand Up @@ -96,7 +96,7 @@ def test_usage_policy_deletion_protected(self):
response = self.client.post(url, {"post": "yes"})
expected = "would require deleting the following protected related objects"
self.assertContains(response, expected)
self.assertNotContains(response, 'type="submit"')
self.assertNotContains(response, 'Yes, I’m sure')

def test_usage_policy_changeform_update_content_type_once_assigned(self):
self.client.login(username="test", password="secret")
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Expand Up @@ -59,7 +59,7 @@ install_requires =
# Django apps
django-crispy-forms==2.1
crispy_bootstrap5==2023.10
django-grappelli==3.0.8
django-grappelli==4.0.1
django-filter==24.1
django-registration==3.4
confusable_homoglyphs==3.2.0
Expand Down
14 changes: 0 additions & 14 deletions thirdparty/dist/django_grappelli-3.0.8-py2.py3-none-any.whl.ABOUT

This file was deleted.

Binary file not shown.

0 comments on commit a5222f7

Please sign in to comment.