Fakultas Ilmu Komputer UI
Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
ppl-fasilkom-ui
2020
PPL-C
Diskominfo-D'Blood
Mantan Aab-D Blood
Commits
4e995df1
Commit
4e995df1
authored
Jun 08, 2020
by
Nabila Febri Viola
Browse files
[REFACTOR] Customize user admin
parent
f1562644
Changes
1
Hide whitespace changes
Inline
Side-by-side
backend/main/admin.py
View file @
4e995df1
...
...
@@ -10,6 +10,12 @@ from .models import User, Profile
class
UserAdmin
(
DjangoUserAdmin
):
"""Define admin model for custom User model with no username field."""
readonly_fields
=
(
'email'
,
'first_name'
,
'last_name'
,
'last_login'
,
'date_joined'
)
fieldsets
=
(
(
None
,
{
'fields'
:
(
'email'
,
'password'
)}),
(
_
(
'Personal info'
),
{
'fields'
:
(
'first_name'
,
'last_name'
)}),
...
...
@@ -28,6 +34,9 @@ class UserAdmin(DjangoUserAdmin):
search_fields
=
(
'email'
,
'first_name'
,
'last_name'
)
ordering
=
(
'email'
,)
class
Media
:
js
=
[
settings
.
MEDIA_URL
+
'/js/user_custom_admin.js'
,
]
@
admin
.
register
(
Profile
)
class
ProfileAdmin
(
admin
.
ModelAdmin
):
...
...
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