mirror of
https://github.com/jazzband/django-defender.git
synced 2026-03-16 22:10:32 +00:00
Run black with Python 2.7 as target version to unify the code styling and make it more linter and style guide compliant
30 lines
626 B
Python
30 lines
626 B
Python
from django.contrib import admin
|
|
from .models import AccessAttempt
|
|
|
|
|
|
class AccessAttemptAdmin(admin.ModelAdmin):
|
|
""" Access attempt admin config """
|
|
|
|
list_display = (
|
|
"attempt_time",
|
|
"ip_address",
|
|
"user_agent",
|
|
"username",
|
|
"path_info",
|
|
"login_valid",
|
|
)
|
|
|
|
search_fields = [
|
|
"ip_address",
|
|
"username",
|
|
]
|
|
|
|
date_hierarchy = "attempt_time"
|
|
|
|
fieldsets = (
|
|
(None, {"fields": ("path_info", "login_valid")}),
|
|
("Meta Data", {"fields": ("user_agent", "ip_address")}),
|
|
)
|
|
|
|
|
|
admin.site.register(AccessAttempt, AccessAttemptAdmin)
|