Skip to content

Commit

Permalink
Fixes logic on public project checkbox
Browse files Browse the repository at this point in the history
  • Loading branch information
janash committed May 21, 2024
1 parent 2b3774b commit 104b355
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion seamm_dashboard/routes/projects/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,11 +188,16 @@ def manage_project(project_id):
if request.method == "POST":
if form.validate_on_submit():

if form.allow_public:
if form.allow_public.data:

Check warning on line 191 in seamm_dashboard/routes/projects/views.py

View check run for this annotation

Codecov / codecov/patch

seamm_dashboard/routes/projects/views.py#L191

Added line #L191 was not covered by tests
permissions = deepcopy(project.permissions)
permissions["other"] = ["read"]
project.permissions = permissions
db.session.commit()
else:
permissions = deepcopy(project.permissions)
permissions["other"] = []
project.permissions = permissions
db.session.commit()

Check warning on line 200 in seamm_dashboard/routes/projects/views.py

View check run for this annotation

Codecov / codecov/patch

seamm_dashboard/routes/projects/views.py#L197-L200

Added lines #L197 - L200 were not covered by tests

user_keys = [
x for x in form.data.keys() if "user" in x if form.data[x] is True
Expand Down

0 comments on commit 104b355

Please sign in to comment.