Commit a9813a4d authored by Lukas Burgey's avatar Lukas Burgey
Browse files

Add custom user creation form

parent 1910b426
......@@ -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'
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment