Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
thalia
concrexit
Commits
96ff2d5c
Verified
Commit
96ff2d5c
authored
Sep 01, 2017
by
Sébastiaan Versteeg
Browse files
Add filter for 'active' and more display fields to committee admin
parent
f93d2ab3
Changes
1
Hide whitespace changes
Inline
Side-by-side
website/activemembers/admin.py
View file @
96ff2d5c
...
...
@@ -31,7 +31,8 @@ class CommitteeMembershipInline(admin.StackedInline):
@
admin
.
register
(
models
.
Committee
)
class
CommitteeAdmin
(
TranslatedModelAdmin
):
inlines
=
(
CommitteeMembershipInline
,)
list_filter
=
(
'until'
,)
list_display
=
(
'name'
,
'since'
,
'until'
,
'active'
,
'email'
)
list_filter
=
(
'until'
,
'active'
,)
search_fields
=
(
'name'
,
'description'
)
filter_horizontal
=
(
'permissions'
,)
...
...
@@ -39,6 +40,13 @@ class CommitteeAdmin(TranslatedModelAdmin):
'until'
,
'contact_mailinglist'
,
'contact_email'
,
'wiki_namespace'
,
'active'
)
def
email
(
self
,
instance
):
if
instance
.
contact_email
:
return
instance
.
contact_email
elif
instance
.
contact_mailinglist
:
return
instance
.
contact_mailinglist
.
name
+
'@thalia.nu'
return
None
def
get_queryset
(
self
,
request
):
qs
=
super
().
get_queryset
(
request
)
return
qs
.
exclude
(
board__is_board
=
True
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment