new accounts are automatically allowed by default.
This commit is contained in:
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user