Skip to content
Snippets Groups Projects
Commit c85ef0d3 authored by Allen Gilliland's avatar Allen Gilliland
Browse files

migrate existing installations and automatically set the `:admin-email` if it...

migrate existing installations and automatically set the `:admin-email` if it hasn't been set before.
parent 2f3c8eb2
Branches
Tags
No related merge requests found
......@@ -80,3 +80,9 @@
:db_id [in (k/subselect Database
(k/fields :id)
(k/where {:engine engine}))]}))))
;; Populate the initial value for the `:admin-email` setting for anyone who hasn't done it yet
(defmigration set-admin-email
(when-not (setting/get :admin-email)
(setting/set :admin-email (db/sel :one :field ['User :email] (k/where {:is_superuser true :is_active true})))))
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment