Skip to content

Commit

Permalink
Pending users Admin filters
Browse files Browse the repository at this point in the history
  • Loading branch information
szabozoltan69 committed Jun 28, 2024
1 parent 619042c commit 689cdd2
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion registrations/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from django.contrib import admin
from django.http import HttpResponseRedirect
from django.template.loader import render_to_string
from django_admin_listfilter_dropdown.filters import RelatedDropdownFilter
from reversion_compare.admin import CompareVersionAdmin

import registrations.models as models
Expand All @@ -26,7 +27,11 @@ class PendingAdmin(CompareVersionAdmin):
search_fields = ("user__username", "user__email", "admin_contact_1", "admin_contact_2")
list_display = ("get_username_and_mail", "get_region", "get_country", "created_at", "email_verified")
actions = ("activate_users",)
list_filter = ["email_verified"]
list_filter = (
"email_verified",
("user__profile__country__region", RelatedDropdownFilter),
("user__profile__country", RelatedDropdownFilter)
)

change_form_template = "admin/pending_change_form.html"
change_list_template = "admin/pending_change_list.html"
Expand Down

0 comments on commit 689cdd2

Please sign in to comment.