Prevent saving environment roles as empty strings
This commit is contained in:
parent
e1767488c7
commit
8fd1d93f2e
@ -27,7 +27,7 @@ class Environments(object):
|
||||
db.session.commit()
|
||||
|
||||
@classmethod
|
||||
def add_member(cls, user, environment, member, role=None):
|
||||
def add_member(cls, environment, member, role):
|
||||
environment_user = EnvironmentRole(
|
||||
user=member, environment=environment, role=role
|
||||
)
|
||||
|
@ -14,9 +14,6 @@ class Projects(object):
|
||||
project = Project(workspace=workspace, name=name, description=description)
|
||||
Environments.create_many(project, environment_names)
|
||||
|
||||
for environment in project.environments:
|
||||
Environments.add_member(user, environment, user)
|
||||
|
||||
db.session.add(project)
|
||||
db.session.commit()
|
||||
|
||||
|
@ -249,7 +249,8 @@ def update_member(workspace_id, member_id):
|
||||
if re.match("env_", entry):
|
||||
env_id = entry[4:]
|
||||
env_role = form_dict[entry]
|
||||
ids_and_roles.append({"id": env_id, "role": env_role})
|
||||
if env_role:
|
||||
ids_and_roles.append({"id": env_id, "role": env_role})
|
||||
|
||||
form = EditMemberForm(http_request.form)
|
||||
|
||||
|
@ -74,8 +74,6 @@
|
||||
</span>
|
||||
|
||||
<div class='project-list-item__environment__actions'>
|
||||
<div>{{ form.data["environment_role"] }}</div>
|
||||
|
||||
<span v-bind:class="label_class" v-html:on=displayName></span>
|
||||
<button v-on:click="openModal('{{ env.name }}RolesModal')" type="button" class="icon-link">set role</button>
|
||||
{% call Modal(name=env.name + 'RolesModal', dismissable=False) %}
|
||||
|
Loading…
x
Reference in New Issue
Block a user