Merge pull request #4458 from penpot/niwinz-staging-bugfix-2

 Minor enhancements
This commit is contained in:
Alejandro 2024-04-17 06:40:42 +02:00 committed by GitHub
commit 88f46f2ab2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 17 additions and 5 deletions

View file

@ -46,6 +46,10 @@
(let [email (str/lower email) (let [email (str/lower email)
email (if (str/starts-with? email "mailto:") email (if (str/starts-with? email "mailto:")
(subs email 7) (subs email 7)
email)
email (if (or (str/starts-with? email "<")
(str/ends-with? email ">"))
(str/trim email "<>")
email)] email)]
email)) email))

View file

@ -139,7 +139,7 @@
:else :else
(try (try
(l/trc :hint "start" (l/dbg :hint "start"
:name (:name task) :name (:name task)
:task-id (str task-id) :task-id (str task-id)
:queue queue :queue queue
@ -149,7 +149,7 @@
result (handle-task task) result (handle-task task)
elapsed (dt/format-duration (tpoint))] elapsed (dt/format-duration (tpoint))]
(l/trc :hint "end" (l/dbg :hint "end"
:name (:name task) :name (:name task)
:task-id (str task-id) :task-id (str task-id)
:queue queue :queue queue
@ -228,7 +228,7 @@
(recur)))) (recur))))
(catch InterruptedException _ (catch InterruptedException _
(l/debug :hint "interrupted" (l/dbg :hint "interrupted"
:id id :id id
:queue queue)) :queue queue))
(catch Throwable cause (catch Throwable cause

View file

@ -27,6 +27,14 @@
(t/use-fixtures :once th/state-init) (t/use-fixtures :once th/state-init)
(t/use-fixtures :each th/database-reset) (t/use-fixtures :each th/database-reset)
(t/deftest clean-email
(t/is "foo@example.com" (profile/clean-email "mailto:foo@example.com"))
(t/is "foo@example.com" (profile/clean-email "mailto:<foo@example.com>"))
(t/is "foo@example.com" (profile/clean-email "<foo@example.com>"))
(t/is "foo@example.com" (profile/clean-email "foo@example.com>"))
(t/is "foo@example.com" (profile/clean-email "<foo@example.com")))
;; Test with wrong credentials ;; Test with wrong credentials
(t/deftest profile-login-failed-1 (t/deftest profile-login-failed-1
(let [profile (th/create-profile* 1) (let [profile (th/create-profile* 1)