Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
R
red_brick_board
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ciella Francisco
red_brick_board
Commits
8ee3262a
Commit
8ee3262a
authored
Mar 09, 2024
by
gab
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
modified django-admin to consider email, not password
parent
24dcbd38
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
0 deletions
+31
-0
admin.py
redbrickboard/accounts/admin.py
+31
-0
No files found.
redbrickboard/accounts/admin.py
0 → 100644
View file @
8ee3262a
from
django.contrib
import
admin
from
django.contrib.auth.admin
import
UserAdmin
as
DjangoUserAdmin
from
.forms
import
CustomUserCreationForm
from
.models
import
CustomUser
# Register your models here.
@
admin
.
register
(
CustomUser
)
class
UserAdmin
(
DjangoUserAdmin
):
add_form
=
CustomUserCreationForm
# form = CustomUserChangeForm
model
=
CustomUser
fieldsets
=
(
(
None
,
{
'fields'
:
(
'email'
,
'password'
)}),
((
'Personal info'
),
{
'fields'
:
(
'first_name'
,
'last_name'
)}),
((
'Permissions'
),
{
'fields'
:
(
'is_active'
,
'is_staff'
,
'is_superuser'
,
'groups'
,
'user_permissions'
)}),
((
'Important dates'
),
{
'fields'
:
(
'last_login'
,
'date_joined'
)}),
)
add_fieldsets
=
(
(
None
,
{
'classes'
:
(
'wide'
,),
'fields'
:
(
'email'
,
'password1'
,
'password2'
),
}),
)
list_display
=
(
'email'
,
'first_name'
,
'last_name'
,
'is_staff'
)
search_fields
=
(
'email'
,
'first_name'
,
'last_name'
)
ordering
=
(
'email'
,)
# admin.site.register(CustomUser, CustomUserAdmin)
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a 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