From e5824adaec2b5db099c2fe7f66fd4d140920282d Mon Sep 17 00:00:00 2001 From: Josha von Gizycki Date: Sun, 30 Sep 2018 23:06:38 +0200 Subject: [PATCH] fix pre checks --- src/formulare/core.clj | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/formulare/core.clj b/src/formulare/core.clj index 9f4dd93..2a50f9a 100644 --- a/src/formulare/core.clj +++ b/src/formulare/core.clj @@ -122,7 +122,7 @@ (str (hash [def values]))) (defn render-widgets [form-def values req] - {:pre [(spec/assert ::form form-def)]} + {:pre [(spec/valid? ::form form-def)]} (let [form-hash (form-hash form-def values) submitted-hash (get-in req [:params :__form-hash]) validate? (= form-hash submitted-hash)] @@ -141,7 +141,7 @@ (anti-forgery-field)))) (defn form-data [form-def req] - {:pre [(spec/assert ::form form-def)]} + {:pre [(spec/valid? ::form form-def)]} (reduce (fn [coll [id field]] (let [value (get-in req [:params id])] (assoc coll