Commit 0611c5c6 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Fix deploy key api 500 if key is empty

parent 50e8d6c0
...@@ -428,6 +428,7 @@ module API ...@@ -428,6 +428,7 @@ module API
post ":id/keys" do post ":id/keys" do
attrs = attributes_for_keys [:title, :key] attrs = attributes_for_keys [:title, :key]
if attrs[:key].present?
attrs[:key].strip! attrs[:key].strip!
# check if key already exist in project # check if key already exist in project
...@@ -444,6 +445,7 @@ module API ...@@ -444,6 +445,7 @@ module API
present key, with: Entities::SSHKey present key, with: Entities::SSHKey
return return
end end
end
key = DeployKey.new attrs key = DeployKey.new attrs
......
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