Andrea Fazzi 5 rokov pred
rodič
commit
36ff030f30
3 zmenil súbory, kde vykonal 5 pridanie a 1 odobranie
  1. 0 1
      handlers/handlers.go
  2. 2 0
      main.go
  3. 3 0
      renderer/renderer.go

+ 0 - 1
handlers/handlers.go

@@ -211,7 +211,6 @@ func post(w http.ResponseWriter, r *http.Request, model string, pattern PathPatt
 		} else if pattern.RedirectPattern != "" {
 			if id := mux.Vars(r)["id"]; id != "" {
 				modelId, _ := strconv.Atoi(id)
-				log.Println(model, modelId, pattern)
 				http.Redirect(w, r, pattern.RedirectPath(model, uint(modelId)), http.StatusSeeOther)
 			} else {
 				http.Redirect(w, r, pattern.RedirectPath(model, data.GetID()), http.StatusSeeOther)

+ 2 - 0
main.go

@@ -69,6 +69,8 @@ func main() {
 		config.Config.Sync.Schedule = "@every 10m"
 	}
 
+	log.Printf("Adding LDAP Sync Job with schedule set at %s", config.Config.Sync.Schedule)
+	log.Printf("Sync will run with SAFE mode set to %v", config.Config.Sync.SafeRun)
 	c.AddJob(config.Config.Sync.Schedule, syncJob)
 
 	c.Start()

+ 3 - 0
renderer/renderer.go

@@ -257,6 +257,9 @@ func Decode(dst interface{}, r *http.Request) error {
 
 	case "html":
 		var timeConverter = func(value string) reflect.Value {
+			if value == "" {
+				return reflect.ValueOf(time.Time{})
+			}
 			if v, err := time.Parse("2006-01-02", value); err == nil {
 				return reflect.ValueOf(v)
 			}