diff --git a/advlabdb/adminModelViews.py b/advlabdb/adminModelViews.py index 6998b81..4ce372b 100644 --- a/advlabdb/adminModelViews.py +++ b/advlabdb/adminModelViews.py @@ -119,15 +119,19 @@ class UserView(SecureAdminModelView): ) phone_number = StringField( "Phone Number", + validators=[Optional()], ) mobile_phone_number = StringField( "Mobile Phone Number", + validators=[Optional()], ) building = StringField( "Building", + validators=[Optional()], ) room = StringField( "Room", + validators=[Optional()], ) semester_experiments = QuerySelectMultipleField( @@ -155,7 +159,7 @@ class UserView(SecureAdminModelView): semester_experiments = None generate_new_password = BooleanField( - "Generate new random password", + "Generate new random password. For security reasons, it is not possible to manually enter a password. Please use a password manager like Bitwarden or KeepassXC to save the randomly generated password.", default=False, ) diff --git a/advlabdb/assistantModelViews.py b/advlabdb/assistantModelViews.py index 8d24536..43e0b85 100644 --- a/advlabdb/assistantModelViews.py +++ b/advlabdb/assistantModelViews.py @@ -142,13 +142,28 @@ class AssistantExperimentMarkView(SecureAssistantModelView): class AssistantUserView(SecureAssistantModelView): class EditForm(Form): - phone_number = StringField("Phone Number") - mobile_phone_number = StringField("Mobile Phone Number") + phone_number = StringField( + "Phone Number", + validators=[Optional()], + ) + mobile_phone_number = StringField( + "Mobile Phone Number", + validators=[Optional()], + ) - building = StringField("Building") - room = StringField("Room") + building = StringField( + "Building", + validators=[Optional()], + ) + room = StringField( + "Room", + validators=[Optional()], + ) - generate_new_password = BooleanField("Generate new random password", default=False) + generate_new_password = BooleanField( + "Generate new random password. For security reasons, it is not possible to manually enter a password. Please use a password manager like Bitwarden or KeepassXC to save the randomly generated password.", + default=False, + ) can_edit = True column_display_actions = True