mirror of
https://github.com/penpot/penpot.git
synced 2025-02-13 18:48:37 -05:00
📎 Add better auditlog event for profile email change event.
This commit is contained in:
parent
e0e8fd7ddc
commit
71fe7ef125
2 changed files with 9 additions and 8 deletions
|
@ -34,10 +34,15 @@
|
||||||
(when (profile/retrieve-profile-data-by-email conn email)
|
(when (profile/retrieve-profile-data-by-email conn email)
|
||||||
(ex/raise :type :validation
|
(ex/raise :type :validation
|
||||||
:code :email-already-exists))
|
:code :email-already-exists))
|
||||||
|
|
||||||
(db/update! conn :profile
|
(db/update! conn :profile
|
||||||
{:email email}
|
{:email email}
|
||||||
{:id profile-id})
|
{:id profile-id})
|
||||||
claims)
|
|
||||||
|
(with-meta claims
|
||||||
|
{::audit/name "update-profile-email"
|
||||||
|
::audit/props {:email email}
|
||||||
|
::audit/profile-id profile-id}))
|
||||||
|
|
||||||
(defn- annotate-profile-activation
|
(defn- annotate-profile-activation
|
||||||
"A helper for properly increase the profile-activation metric once the
|
"A helper for properly increase the profile-activation metric once the
|
||||||
|
|
|
@ -87,13 +87,9 @@
|
||||||
|
|
||||||
(defn retrieve-profile
|
(defn retrieve-profile
|
||||||
[conn id]
|
[conn id]
|
||||||
(let [profile (some->> (retrieve-profile-data conn id)
|
(let [profile (->> (retrieve-profile-data conn id)
|
||||||
(strip-private-attrs)
|
(strip-private-attrs)
|
||||||
(populate-additional-data conn))]
|
(populate-additional-data conn))]
|
||||||
(when (nil? profile)
|
|
||||||
(ex/raise :type :not-found
|
|
||||||
:hint "Object doest not exists."))
|
|
||||||
|
|
||||||
(update profile :props filter-profile-props)))
|
(update profile :props filter-profile-props)))
|
||||||
|
|
||||||
(def ^:private sql:profile-by-email
|
(def ^:private sql:profile-by-email
|
||||||
|
|
Loading…
Add table
Reference in a new issue