Improvements to user management
This commit is contained in:
+21
-2
@@ -6,12 +6,15 @@ from django.forms import (
|
||||
ChoiceField,
|
||||
CharField,
|
||||
HiddenInput,
|
||||
EmailField,
|
||||
IntegerField
|
||||
|
||||
)
|
||||
from django.forms import inlineformset_factory
|
||||
from atlas.models import CaseCollection
|
||||
from django.contrib.auth.models import User
|
||||
|
||||
from generic.models import CidUser, CidUserGroup, Examination, QuestionNote, UserProfile, UserUserGroup
|
||||
from generic.models import CidUser, CidUserGroup, Examination, QuestionNote, Supervisor, UserProfile, UserUserGroup
|
||||
|
||||
from django.contrib.admin.widgets import FilteredSelectMultiple
|
||||
from django.forms.widgets import RadioSelect, TextInput, Textarea
|
||||
@@ -258,4 +261,20 @@ class UserUserGroupForm(ModelForm):
|
||||
#class UserProfileForm(ModelForm):
|
||||
# class Meta:
|
||||
# model = UserProfile
|
||||
# fields = ["supervisor_name", "supervisor_email", "registration_number", "peninsula_trainee"]
|
||||
# fields = ["supervisor_name", "supervisor_email", "registration_number", "peninsula_trainee"]
|
||||
|
||||
class UserUserForm(Form):
|
||||
username = EmailField(required=True, help_text="Username / email should be the same. Ideally this should be an nhs email.")
|
||||
first_name = CharField(max_length=255, required=True)
|
||||
last_name = CharField(max_length=255, required=True)
|
||||
grade = IntegerField(min_value=1, max_value=6, required=False)
|
||||
supervisor = CharField(max_length=255, required=False) # Needs to be a user/object ref
|
||||
#
|
||||
# class Meta:
|
||||
#
|
||||
# fields = ("username", "first_name", "last_name")
|
||||
|
||||
class SupervisorForm(ModelForm):
|
||||
class Meta:
|
||||
model = Supervisor
|
||||
exclude = ("",)
|
||||
Reference in New Issue
Block a user