mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-01 15:07:17 +08:00
fix(notify): avoid duplication of notification names
This commit is contained in:
@@ -128,7 +128,11 @@ func (nm *SNotificationManager) ValidateCreateData(ctx context.Context, userCred
|
||||
if len(input.Topic) < 10 {
|
||||
length = len(input.Topic)
|
||||
}
|
||||
input.Name = fmt.Sprintf("%s-%s-%s", input.Topic[:length], input.ContactType, nowStr)
|
||||
name := fmt.Sprintf("%s-%s-%s", input.Topic[:length], input.ContactType, nowStr)
|
||||
input.Name, err = db.GenerateName(nm, ownerId, name)
|
||||
if err != nil {
|
||||
return input, errors.Wrapf(err, "unable to generate name for %s", name)
|
||||
}
|
||||
return input, nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user