Commit 3e281f95 authored by Robert Schilling's avatar Robert Schilling

Only update once

parent e552b4af
...@@ -51,8 +51,9 @@ module API ...@@ -51,8 +51,9 @@ module API
developers_can_merge = to_boolean(params[:developers_can_merge]) developers_can_merge = to_boolean(params[:developers_can_merge])
if protected_branch if protected_branch
protected_branch.update(developers_can_push: developers_can_push) unless developers_can_push.nil? protected_branch.developers_can_push = developers_can_push unless developers_can_push.nil?
protected_branch.update(developers_can_merge: developers_can_merge) unless developers_can_merge.nil? protected_branch.developers_can_merge = developers_can_merge unless developers_can_merge.nil?
protected_branch.save
else else
user_project.protected_branches.create(name: @branch.name, user_project.protected_branches.create(name: @branch.name,
developers_can_push: developers_can_push || false, developers_can_push: developers_can_push || false,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment