fix for tp actiontrigger id

This commit is contained in:
Radu Ioan Fericean
2015-02-09 13:17:25 +02:00
parent 56b37feafe
commit dbcc21c4d5

View File

@@ -608,10 +608,14 @@ func (self *SQLStorage) SetTPActionTriggers(tpid string, ats map[string][]*utils
tx.Rollback()
return err
}
for idx, at := range aTriggers {
for _, at := range aTriggers {
id := at.Id
if id == "" {
id = utils.GenUUID()
}
saved := tx.Save(TpActionTrigger{
Tpid: tpid,
Tag: atId + strconv.Itoa(idx),
UniqueId: id,
ThresholdType: at.ThresholdType,
ThresholdValue: at.ThresholdValue,
Recurrent: at.Recurrent,
@@ -1438,6 +1442,7 @@ func (self *SQLStorage) GetTpActionTriggers(tpid, tag string) (map[string][]*uti
}
for _, tpAt := range tpActionTriggers {
at := &utils.TPActionTrigger{
Id: tpAt.UniqueId,
ThresholdType: tpAt.ThresholdType,
ThresholdValue: tpAt.ThresholdValue,
Recurrent: tpAt.Recurrent,