Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
feudal
feudalBackend
Commits
a9813a4d
Commit
a9813a4d
authored
Jan 30, 2020
by
Lukas Burgey
Browse files
Add custom user creation form
parent
1910b426
Changes
1
Hide whitespace changes
Inline
Side-by-side
feudal/backend/admin.py
View file @
a9813a4d
...
...
@@ -2,6 +2,7 @@
from
django.contrib
import
admin
from
django.contrib.auth.admin
import
UserAdmin
from
django.contrib.auth.models
import
Group
as
AuthGroup
from
django.contrib.auth.forms
import
UserCreationForm
from
polymorphic.admin
import
PolymorphicParentModelAdmin
,
PolymorphicChildModelAdmin
...
...
@@ -11,6 +12,14 @@ from .auth.v1.models import OIDCConfig
from
.auth.v1.models.vo
import
VO
,
Group
,
Entitlement
,
EntitlementNameSpace
# from https://docs.djangoproject.com/en/2.2/topics/auth/customizing/#custom-users-and-the-built-in-auth-forms
class
CustomUserCreationForm
(
UserCreationForm
):
class
Meta
(
UserCreationForm
.
Meta
):
model
=
models
.
User
fields
=
UserCreationForm
.
Meta
.
fields
+
(
'user_type'
,)
class
TypeFilter
(
admin
.
SimpleListFilter
):
title
=
'Type'
parameter_name
=
'user_type'
...
...
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