Browse Source

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

pull/2603/head
Samler 4 weeks ago
committed by GitHub
parent
commit
19a65b065c
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 4
      inventory/group.go

4
inventory/group.go

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

Loading…
Cancel
Save