fix: [user init] explicit uuid creation removed

- added behavior wherever it was missing
pull/92/head
iglocska 2021-11-24 23:32:17 +01:00
parent 716f6b1147
commit c7768921fb
No known key found for this signature in database
GPG Key ID: BEA224F1FEF113AC
2 changed files with 2 additions and 5 deletions

View File

@ -21,6 +21,7 @@ class OrganisationsTable extends AppTable
$this->addBehavior('Timestamp'); $this->addBehavior('Timestamp');
$this->addBehavior('Tags.Tag'); $this->addBehavior('Tags.Tag');
$this->addBehavior('AuditLog'); $this->addBehavior('AuditLog');
$this->addBehavior('UUID');
$this->hasMany( $this->hasMany(
'Alignments', 'Alignments',
[ [

View File

@ -115,7 +115,6 @@ class UsersTable extends AppTable
$this->Roles = TableRegistry::get('Roles'); $this->Roles = TableRegistry::get('Roles');
$role = $this->Roles->newEntity([ $role = $this->Roles->newEntity([
'name' => 'admin', 'name' => 'admin',
'uuid' => Text::uuid(),
'perm_admin' => 1, 'perm_admin' => 1,
'perm_org_admin' => 1, 'perm_org_admin' => 1,
'perm_sync' => 1 'perm_sync' => 1
@ -123,21 +122,18 @@ class UsersTable extends AppTable
$this->Roles->save($role); $this->Roles->save($role);
$this->Organisations = TableRegistry::get('Organisations'); $this->Organisations = TableRegistry::get('Organisations');
$organisation = $this->Organisations->newEntity([ $organisation = $this->Organisations->newEntity([
'name' => 'default_organisation', 'name' => 'default_organisation'
'uuid' => Text::uuid()
]); ]);
$this->Organisations->save($organisation); $this->Organisations->save($organisation);
$this->Individuals = TableRegistry::get('Individuals'); $this->Individuals = TableRegistry::get('Individuals');
$individual = $this->Individuals->newEntity([ $individual = $this->Individuals->newEntity([
'email' => 'admin@admin.test', 'email' => 'admin@admin.test',
'uuid' => Text::uuid(),
'first_name' => 'admin', 'first_name' => 'admin',
'last_name' => 'admin' 'last_name' => 'admin'
]); ]);
$this->Individuals->save($individual); $this->Individuals->save($individual);
$user = $this->newEntity([ $user = $this->newEntity([
'username' => 'admin', 'username' => 'admin',
'uuid' => Text::uuid(),
'password' => 'Password1234', 'password' => 'Password1234',
'individual_id' => $individual->id, 'individual_id' => $individual->id,
'oganisation_id' => $organisation->id, 'oganisation_id' => $organisation->id,