fix master relations not being set
This commit is contained in:
parent
e3467605b5
commit
88c6857e24
@ -131,6 +131,7 @@ public class InitService
|
||||
Name = "Master",
|
||||
IsMaster = true,
|
||||
OwnerId = housemasterUser.Id!.Value,
|
||||
Subjects = [housemasterUser]
|
||||
};
|
||||
|
||||
_applicationContext.Tenants.Add(masterTenant);
|
||||
@ -141,21 +142,14 @@ public class InitService
|
||||
Visibility = EntityVisibility.Active,
|
||||
TenantId = masterTenant.Id!.Value,
|
||||
Name = "Master",
|
||||
BaseAddress = baseAddress
|
||||
BaseAddress = baseAddress,
|
||||
Tenant = masterTenant,
|
||||
Subjects = [housemasterUser]
|
||||
};
|
||||
|
||||
_applicationContext.Apps.Add(masterApp);
|
||||
await _applicationContext.SaveChangesAsync();
|
||||
|
||||
var appSubjectRelation = new AppSubjectRelationEntity
|
||||
{
|
||||
AppId = masterApp.Id!.Value,
|
||||
SubjectId = housemasterUser.Id!.Value
|
||||
};
|
||||
|
||||
_applicationContext.AppSubjectRelations.Add(appSubjectRelation);
|
||||
await _applicationContext.SaveChangesAsync();
|
||||
|
||||
_logger.LogInformation($"""
|
||||
----- Housemaster initial login information -----
|
||||
username: {housemasterUser.Name}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user