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
b12038a3
Verified
Commit
b12038a3
authored
Nov 03, 2017
by
Sébastiaan Versteeg
Browse files
Change default push notifications device ordering
parent
826d850e
Changes
1
Hide whitespace changes
Inline
Side-by-side
website/pushnotifications/admin.py
View file @
b12038a3
...
...
@@ -10,7 +10,7 @@ class DeviceAdmin(admin.ModelAdmin):
list_display
=
(
'name'
,
'type'
,
'active'
,
'date_created'
)
list_filter
=
(
'active'
,
'type'
)
actions
=
(
'enable'
,
'disable'
)
ordering
=
(
'user__first_name'
,
)
search_fields
=
(
'registration_id'
,
'user__username'
,
'user__first_name'
,
'user__last_name'
)
...
...
@@ -25,6 +25,7 @@ class DeviceAdmin(admin.ModelAdmin):
def
name
(
self
,
obj
):
return
'{} ({})'
.
format
(
obj
.
user
.
get_full_name
(),
obj
.
user
.
username
)
name
.
short_description
=
_
(
'Name'
)
name
.
admin_order_field
=
'user__first_name'
@
admin
.
register
(
models
.
Message
)
...
...
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