From 773b63c900fdf8706bb76e041f12df0bc768ab7c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alberto=20Miedes=20Garc=C3=A9s?= Date: Mon, 31 Aug 2020 10:47:22 +0200 Subject: [PATCH] Fix log_context for GroupsController --- app/controllers/carto/api/groups_controller.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/controllers/carto/api/groups_controller.rb b/app/controllers/carto/api/groups_controller.rb index 0971f14867..37e4689561 100644 --- a/app/controllers/carto/api/groups_controller.rb +++ b/app/controllers/carto/api/groups_controller.rb @@ -44,12 +44,12 @@ module Carto end def create - group = @organization.create_group(params['display_name']) - render_jsonp(Carto::Api::GroupPresenter.full(group).to_poro, 200) + @group = @organization.create_group(params['display_name']) + render_jsonp(Carto::Api::GroupPresenter.full(@group).to_poro, 200) rescue CartoDB::ModelAlreadyExistsError => e render json: { errors: ["A group with that name already exists"] }, status: 409 rescue ActiveRecord::StatementInvalid => e - handle_statement_invalid_error(e, group) + handle_statement_invalid_error(e, @group) rescue StandardError => e log_error(exception: e) render json: { errors: [e.message] }, status: 500 @@ -174,7 +174,7 @@ module Carto end def log_context - super.merge(params: params, group: group, organization: @organization) + super.merge(params: params, group: @group, organization: @organization) end end end