returnerror(_(%q(You are not allowed to push into this branch. Create another branch or open a merge request.)),:forbidden)unlesspush_authorized?
returnerror(_('You are not allowed to push into this branch. Create another branch or open a merge request.'),:forbidden)unlesspush_authorized?
success(result)
end
defcheck_branch_name(result)
returnerror(_(%q(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 named: %{branch} already exists.))%{branch: params[:branch]},:bad_request)unlessnew_or_default_branch?
returnerror(_('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.')%{branch: params[:branch]},:bad_request)unlessnew_or_default_branch?
success(result)
end
defcheck_file_type(result)
returnerror(_(%q(The file name should have a .yml extension)),:bad_request)unlesstarget_file_type_valid?
returnerror(_('The file name should have a .yml extension'),:bad_request)unlesstarget_file_type_valid?