Create form class for app env settings
This commit is contained in:
parent
1d466ff1d4
commit
5de1b859db
15
atst/forms/app_settings.py
Normal file
15
atst/forms/app_settings.py
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
from wtforms.fields import StringField, HiddenField, RadioField, FieldList, FormField
|
||||||
|
|
||||||
|
from .forms import BaseForm
|
||||||
|
from .data import ENV_ROLES
|
||||||
|
|
||||||
|
|
||||||
|
class EnvMemberRoleForm(BaseForm):
|
||||||
|
name = StringField()
|
||||||
|
user_id = HiddenField()
|
||||||
|
role = RadioField(choices=ENV_ROLES)
|
||||||
|
|
||||||
|
|
||||||
|
class EnvironmentForm(BaseForm):
|
||||||
|
team_roles = FieldList(FormField(EnvMemberRoleForm))
|
||||||
|
env_id = HiddenField()
|
@ -1,4 +1,5 @@
|
|||||||
from atst.utils.localization import translate, translate_duration
|
from atst.utils.localization import translate, translate_duration
|
||||||
|
from atst.models.environment_role import CSPRole
|
||||||
|
|
||||||
|
|
||||||
SERVICE_BRANCHES = [
|
SERVICE_BRANCHES = [
|
||||||
@ -215,3 +216,5 @@ REQUIRED_DISTRIBUTIONS = [
|
|||||||
("administrative_ko", "Administrative Contracting Officer"),
|
("administrative_ko", "Administrative Contracting Officer"),
|
||||||
("other", "Other as necessary"),
|
("other", "Other as necessary"),
|
||||||
]
|
]
|
||||||
|
|
||||||
|
ENV_ROLES = [(role.value, role.value) for role in CSPRole]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user