fix pre checks

master
Josha von Gizycki 6 years ago
parent 6ea09ca7f4
commit e5824adaec

@ -122,7 +122,7 @@
(str (hash [def values]))) (str (hash [def values])))
(defn render-widgets [form-def values req] (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) (let [form-hash (form-hash form-def values)
submitted-hash (get-in req [:params :__form-hash]) submitted-hash (get-in req [:params :__form-hash])
validate? (= form-hash submitted-hash)] validate? (= form-hash submitted-hash)]
@ -141,7 +141,7 @@
(anti-forgery-field)))) (anti-forgery-field))))
(defn form-data [form-def req] (defn form-data [form-def req]
{:pre [(spec/assert ::form form-def)]} {:pre [(spec/valid? ::form form-def)]}
(reduce (fn [coll [id field]] (reduce (fn [coll [id field]]
(let [value (get-in req [:params id])] (let [value (get-in req [:params id])]
(assoc coll (assoc coll

Loading…
Cancel
Save