Fix tests

This commit is contained in:
John Baublitz
2018-06-04 13:19:14 +02:00
committed by bergquist
parent fca97535d1
commit c0a9e5cf1d
2 changed files with 26 additions and 14 deletions
@@ -144,6 +144,10 @@ func CreateAlertNotificationCommand(cmd *m.CreateAlertNotificationCommand) error
return fmt.Errorf("Alert notification name %s already exists", cmd.Name)
}
if cmd.Frequency == "" {
return fmt.Errorf("Alert notification frequency required")
}
frequency, err_convert := time.ParseDuration(cmd.Frequency)
if err_convert != nil {
return err
@@ -195,6 +199,10 @@ func UpdateAlertNotification(cmd *m.UpdateAlertNotificationCommand) error {
current.IsDefault = cmd.IsDefault
current.NotifyOnce = cmd.NotifyOnce
if cmd.Frequency == "" {
return fmt.Errorf("Alert notification frequency required")
}
frequency, err_convert := time.ParseDuration(cmd.Frequency)
if err_convert != nil {
return err