lib/octopi/user.rb in fcoury-octopi-0.0.8 vs lib/octopi/user.rb in fcoury-octopi-0.0.9

- old
+ new

@@ -28,10 +28,10 @@ raise APIError, "To add a key, you must be authenticated" if @api.read_only? result = @api.post("/user/key/add", :title => title, :key => key) return if !result["public_keys"] - key_params = result["public_keys"].select { |k| puts "#{title} #{k["title"]} #{k["title"] == title}"; k["title"] == title } + key_params = result["public_keys"].select { |k| k["title"] == title } return if !key_params or key_params.empty? Key.new(@api, key_params.first, self) end def keys