Skip to content

Commit

Permalink
Merge pull request #962 from WesternFriend/custom-users-menu
Browse files Browse the repository at this point in the history
Add custom Registered Users menu item
  • Loading branch information
brylie authored Nov 28, 2023
2 parents 99accb7 + cda24ae commit ee0acbb
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions community/wagtail_hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
)
from wagtail import hooks

from accounts.models import User
from community.models import CommunityDirectory, OnlineWorship
from contact.models import Meeting, Organization, Person
from documents.models import MeetingDocument, PublicBoardDocument
Expand Down Expand Up @@ -190,11 +191,45 @@ class MeetingDocumentModelAdmin(ModelAdmin):
)


class UserModelAdmin(ModelAdmin):
"""User model admin."""

model = User
menu_icon = "group"
menu_label = "Registered Users"
list_per_page = 10
form_fields_exclude = [
"password",
"user_permissions",
]

ordering = [
"last_name",
"first_name",
]
list_display = (
"last_name",
"first_name",
"email",
"date_joined",
"is_active",
"is_subscriber",
)
empty_value_display = "-"
search_fields = (
"first_name",
"last_name",
"email",
)
list_filter = ("is_active",)


class CommunityGroup(ModelAdminGroup):
menu_label = "Community"
menu_icon = "snippet"
menu_order = 200
items = (
UserModelAdmin,
PersonModelAdmin,
MeetingModelAdmin,
OrganizationModelAdmin,
Expand Down

0 comments on commit ee0acbb

Please sign in to comment.