chg: [Command:TrainingShell] Only override org_id if org_uuid is provided

pull/9305/head
Sami Mokaddem 2023-09-27 15:53:07 +02:00
parent 28179ced9c
commit cfc12b38cf
No known key found for this signature in database
GPG Key ID: 164C473F627A06FA
1 changed files with 3 additions and 1 deletions

View File

@ -156,7 +156,9 @@ class TrainingShell extends AppShell {
$config = json_decode($rawConfig, true);
$createdUsers = [];
foreach ($config as $user) {
$user['org_id'] = $createdOrgs[$user['org_uuid']]['id'];
if (!empty($user['org_uuid'])) {
$user['org_id'] = $createdOrgs[$user['org_uuid']]['id'];
}
$existingUser = $this->User->find('first', [
'recursive' => -1,
'conditions' => ['User.email' => $user['email']],