diff --git a/dashmachine/settings_system/routes.py b/dashmachine/settings_system/routes.py index 277f25d..b36b056 100644 --- a/dashmachine/settings_system/routes.py +++ b/dashmachine/settings_system/routes.py @@ -31,6 +31,7 @@ def settings(): config_form = ConfigForm() user_form = UserForm() + user_form.role.choices += [(role, role) for role in settings_db.roles.split(",")] with open(os.path.join(user_data_folder, "config.ini"), "r") as config_file: config_form.config.data = config_file.read() files_html = load_files_html() diff --git a/dashmachine/user_system/forms.py b/dashmachine/user_system/forms.py index e36ca0b..adbfd23 100644 --- a/dashmachine/user_system/forms.py +++ b/dashmachine/user_system/forms.py @@ -11,7 +11,7 @@ class UserForm(FlaskForm): password = PasswordField(validators=[DataRequired(), Length(min=8, max=120)]) - role = SelectField(choices=[(role, role) for role in settings_db.roles.split(",")]) + role = SelectField(choices=[]) id = StringField()