new accounts are automatically allowed by default.

This commit is contained in:
2024-02-07 21:29:29 -08:00
parent 8063a8fcbd
commit 8f3eff4b01

View File

@@ -180,7 +180,7 @@
(defn account-save [{:keys [form-params request-method] :as request}]
(let [entity (cond-> form-params
(= :post request-method) (assoc :db/id "new"))
(= :post request-method) (assoc :db/id "new" :account/default-allowance :allowance/allowed))
_ (cond (= :post request-method)
(when (seq (dc/q '[:find ?x :in $ ?nc :where [?x :account/numeric-code ?nc]] (dc/db conn) (:account/numeric-code entity)))
(field-validation-error (format "The code %d is already in use." (:account/numeric-code entity))