0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-22 14:39:45 -05:00

Add option for disable demo users.

This commit is contained in:
Andrey Antukh 2021-01-29 12:59:12 +01:00 committed by Alonso Torres
parent 393c9cd13c
commit b0749b5595

View file

@ -11,6 +11,7 @@
"A demo specific mutations."
(:require
[app.common.uuid :as uuid]
[app.common.exceptions :as ex]
[app.config :as cfg]
[app.db :as db]
[app.rpc.mutations.profile :as profile]
@ -36,6 +37,12 @@
:fullname fullname
:demo? true
:password password}]
(when-not (:allow-demo-users cfg/config)
(ex/raise :type :validation
:code :demo-users-not-allowed
:hint "Demo users are disabled by config."))
(db/with-atomic [conn pool]
(->> (#'profile/create-profile conn params)
(#'profile/create-profile-relations conn))