Pass environment role choices directly from the view to the template instead of via the form

This commit is contained in:
Montana
2018-09-24 11:17:57 -04:00
parent 54af62a58a
commit 83c4483c42
3 changed files with 8 additions and 8 deletions

View File

@@ -1,17 +1,15 @@
from flask_wtf import FlaskForm
from wtforms.validators import Optional, Required
from wtforms.validators import Required
from atst.forms.fields import SelectField
from .data import WORKSPACE_ROLES, ENVIRONMENT_ROLES
from .data import WORKSPACE_ROLES
class EditMemberForm(FlaskForm):
# This form also accepts a field for each environment in each project
# that the user is a member of
workspace_role = SelectField(
"Workspace Role", choices=WORKSPACE_ROLES, validators=[Required()]
)
environment_role = SelectField(
"Environment Role", choices=ENVIRONMENT_ROLES, validators=[Optional()]
)