   (let [account (select-keys params [:id
                                      :name
                                      :type
-                                     :content-type
                                      :entity-id
-                                     :content-type
                                      :parent-id])
         updated (accounts/update (env :db) account)]
     (if (validation/has-error? updated)

  "Creates the account and redirects to the index page on success, or
  re-renders the new form on failure"
  [{params :params}]
  (let [account (select-keys params [:entity-id :name :type :content-type :parent-id])
        saved (accounts/create (env :db) account)]
    (if (validation/has-error? saved)
      (new-account {:params (select-keys saved [:entity-id])} saved)

    (select-field account :type (map #(vector :option {:value %} (humanize %))
                                     accounts/account-types))
    (select-field account
                  :parent-id
                  (grouped-options-for-accounts (:entity-id account)
                                                {:include-none? true
