mirror of
https://github.com/jazzband/django-defender.git
synced 2026-03-16 22:10:32 +00:00
Improved the "Blocked Logins" page's admin integration (#239)
This commit is contained in:
parent
c290b5a673
commit
07555abd29
2 changed files with 6 additions and 3 deletions
|
|
@ -12,13 +12,13 @@
|
|||
<div class="breadcrumbs">
|
||||
<a href="{% url "admin:index" %}">Home</a> ›
|
||||
<a href="{% url "admin:app_list" "defender" %}">Defender</a> ›
|
||||
{{ title }}
|
||||
</div>
|
||||
{% endblock breadcrumbs %}
|
||||
|
||||
{% block content %}
|
||||
<div id="content-main">
|
||||
|
||||
<h1>Blocked Logins</h1>
|
||||
<p>Here is a list of IP's and usernames that are blocked</p>
|
||||
|
||||
<div class="module">
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
from django.shortcuts import render
|
||||
from django.http import HttpResponseRedirect
|
||||
from django.contrib import admin
|
||||
from django.contrib.admin.views.decorators import staff_member_required
|
||||
from django.urls import reverse
|
||||
|
||||
|
|
@ -13,10 +14,12 @@ def block_view(request):
|
|||
blocked_ip_list = get_blocked_ips()
|
||||
blocked_username_list = get_blocked_usernames()
|
||||
|
||||
context = {
|
||||
context = admin.site.index(request).context_data
|
||||
context.update({
|
||||
"blocked_ip_list": blocked_ip_list,
|
||||
"blocked_username_list": blocked_username_list,
|
||||
}
|
||||
"title": "Blocked logins",
|
||||
})
|
||||
return render(request, "defender/admin/blocks.html", context)
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue