From cc648fcdb338d9899403d04549bfaad834ebdf7c Mon Sep 17 00:00:00 2001 From: Mathieu Magnin Date: Mon, 5 Mar 2018 16:49:17 +0100 Subject: [PATCH] Log siret behaviour to investigate Sentry #2371 --- app/controllers/users/dossiers_controller.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/controllers/users/dossiers_controller.rb b/app/controllers/users/dossiers_controller.rb index 719682931..121693b89 100644 --- a/app/controllers/users/dossiers_controller.rb +++ b/app/controllers/users/dossiers_controller.rb @@ -106,13 +106,16 @@ class Users::DossiersController < UsersController update_current_user_siret!(siret) etablissement_attributes = SIRETService.fetch(siret, @facade.dossier) + Rails.logger.info("etablissement_attributes for siret: #{siret}, present?: #{etablissement_attributes.present?}") if etablissement_attributes.present? etablissement_attributes = ActionController::Parameters.new(etablissement_attributes).permit! etablissement = @facade.dossier.create_etablissement(etablissement_attributes) if etablissement.save + Rails.logger.info("etablissement saved, siret: #{siret}, id: #{etablissement.id}") @facade.dossier.mandataire_social!(current_user.france_connect_information) else + Rails.logger.info("etablissement not saved, siret: #{siret}, errors: #{etablissement.errors.full_messages}") return errors_valid_siret end else