changeset 1737:abcf21649bd1

Configured imports: Always take cron spec from input document when modifying a configuration.
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Wed, 09 Jan 2019 16:28:57 +0100
parents c88e758cb96c
children 8202d485331b
files pkg/controllers/importconfig.go
diffstat 1 files changed, 5 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/pkg/controllers/importconfig.go	Wed Jan 09 15:55:59 2019 +0100
+++ b/pkg/controllers/importconfig.go	Wed Jan 09 16:28:57 2019 +0100
@@ -131,7 +131,7 @@
 	var (
 		entry imports.IDConfig
 		kind  string
-		cron  sql.NullString
+		dummy sql.NullString
 		url   sql.NullString
 	)
 
@@ -141,7 +141,7 @@
 		&kind,
 		&entry.SendEMail,
 		&entry.AutoAccept,
-		&cron,
+		&dummy,
 		&url,
 	)
 
@@ -161,6 +161,9 @@
 	entry.SendEMail = importConfig.SendEMail
 	entry.AutoAccept = importConfig.AutoAccept
 
+	// We always take the cron spec from the input.
+	// If there is no spec remove schedule.
+	var cron sql.NullString
 	if importConfig.Cron != nil {
 		cron = sql.NullString{String: string(*importConfig.Cron), Valid: true}
 	}