From 9d9dd7f22658cb1bab27050c9f4b5cf8c9b8ef6c Mon Sep 17 00:00:00 2001 From: Mario de Frutos Date: Fri, 22 Dec 2017 17:23:33 +0100 Subject: [PATCH] Revert rubocop changes --- .rubocop.yml | 5 +++++ lib/carto/db/connection.rb | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/.rubocop.yml b/.rubocop.yml index 7fa484133c..e03076352d 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -185,6 +185,9 @@ Layout/SpaceBeforeSemicolon: Layout/SpaceAroundOperators: Enabled: true +Layout/SpaceInsideBrackets: + Enabled: true + Layout/SpaceInsideParens: Enabled: true @@ -653,6 +656,8 @@ Lint/ElseLayout: Enabled: false Lint/HandleExceptions: Enabled: false +Lint/LiteralInCondition: + Enabled: false Lint/LiteralInInterpolation: Enabled: false Lint/Loop: diff --git a/lib/carto/db/connection.rb b/lib/carto/db/connection.rb index 115acf922a..18cbc657fa 100644 --- a/lib/carto/db/connection.rb +++ b/lib/carto/db/connection.rb @@ -119,7 +119,9 @@ module Carto schema: options[:user_schema] }) raise Carto::Db::InvalidConfiguration.new('Connection needs user schema if user is not the cluster admin') end - if !options[:as] || (options[:as] && (!options[:username] || !options[:password])) + + ## If we don't pass user type we are using a regular user and username/password is mandatory + if !options[:as] && (!options[:username] || !options[:password]) CartoDB::Logger.error(message: 'Db connection needs username/password for regular user', params: { user_type: options[:as], username: options[:username] }) raise Carto::Db::InvalidConfiguration.new('Db connection needs user username/password for regular user')