fix: new user group error in without replication (#2596)

pull/2603/head
Samler 2025-06-30 19:34:18 +08:00 committed by GitHub
parent e0b2b4649e
commit 19a65b065c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 2 deletions

View File

@ -85,8 +85,8 @@ func (c *groupClient) Upsert(ctx context.Context, group *ent.Group) (*ent.Group,
SetPermissions(group.Permissions). SetPermissions(group.Permissions).
SetSettings(group.Settings) SetSettings(group.Settings)
if group.StoragePolicyID > 0 { if group.Edges.StoragePolicies != nil && group.Edges.StoragePolicies.ID > 0 {
stm.SetStoragePolicyID(group.StoragePolicyID) stm.SetStoragePolicyID(group.Edges.StoragePolicies.ID)
} }
return stm.Save(ctx) return stm.Save(ctx)