From ee44c74d27e05a726bdb23403014d39bd70f9de9 Mon Sep 17 00:00:00 2001 From: Jose Gonzalez Date: Mon, 20 Jan 2020 12:40:19 +0100 Subject: [PATCH] Solved issue with user profile creation --- pandora_server/bin/pandora_server | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pandora_server/bin/pandora_server b/pandora_server/bin/pandora_server index c88562946f..e1d2806e0e 100755 --- a/pandora_server/bin/pandora_server +++ b/pandora_server/bin/pandora_server @@ -662,9 +662,7 @@ sub main() { my $res_tusuario_perfil = db_process_insert($DBH, 'id_user', 'tusuario_perfil', $api_profile_parameters); # If the user was inserted in DB, must write it in configuration file - if ( !$res_tusuario || !$res_tusuario_perfil ) { - logger(\%Config, "Warning. Was not possible creating console user for API.", 3); - } else { + if ( $res_tusuario_perfil > 0 ) { if (open (CFG, ">>$cfg_file")) { print CFG "# Console User (created for API use)\n"; print CFG "console_user " . $Config{"console_user"} . "\n"; @@ -672,6 +670,8 @@ sub main() { } else { logger(\%Config, "Warning. Was not possible edit configuration file for add console user", 3); } + } else { + logger(\%Config, "Warning. Was not possible creating console user for API.", 3); } } }