returnerror("You are not allowed to push into this branch. Create another branch or open a merge request.",:forbidden)unlesspush_authorized?
returnerror(_(%q(You are not allowed to push into this branch. Create another branch or open a merge request.)),:forbidden)unlesspush_authorized?
success(result)
success(result)
end
end
defcheck_branch_name(result)
defcheck_branch_name(result)
returnerror("There was an error updating the dashboard, branch name is invalid.",:bad_request)unlessvalid_branch_name?
returnerror(_(%q(There was an error updating the dashboard, branch name is invalid.)),:bad_request)unlessvalid_branch_name?
returnerror("There was an error updating the dashboard, branch named: #{branch} already exists.",:bad_request)unlessnew_or_default_branch?
returnerror(_('There was an error updating the dashboard, branch named: %{branch} already exists.')%{branch: params[:branch]},:bad_request)unlessnew_or_default_branch?