Refactor application team routes
- pulling out helper functions for constructing forms - return 400 for form validation errors - "Yes" appears green on the read only version
This commit is contained in:
@@ -26,7 +26,7 @@ class PermissionsForm(FlaskForm):
|
||||
)
|
||||
perms_del_env = SelectField(
|
||||
choices=[
|
||||
("View only", "No"),
|
||||
(PermissionSets.VIEW_APPLICATION, "No"),
|
||||
(PermissionSets.DELETE_APPLICATION_ENVIRONMENTS, "Yes"),
|
||||
]
|
||||
)
|
||||
@@ -49,13 +49,6 @@ class MemberForm(FlaskForm):
|
||||
environment_roles = FieldList(FormField(EnvironmentForm))
|
||||
permission_sets = FormField(PermissionsForm)
|
||||
|
||||
@property
|
||||
def data(self):
|
||||
_data = super().data
|
||||
_data.pop("csrf_token", None)
|
||||
|
||||
return _data
|
||||
|
||||
|
||||
class TeamForm(BaseForm):
|
||||
members = FieldList(FormField(MemberForm))
|
||||
|
Reference in New Issue
Block a user