From c6fe03593913ef194f203676aa5efbcbabd34f90 Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Mon, 16 Aug 2021 15:46:25 +0200 Subject: [PATCH] :bug: Fix demo user login issue. --- backend/src/app/rpc/queries/profile.clj | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/backend/src/app/rpc/queries/profile.clj b/backend/src/app/rpc/queries/profile.clj index 5e1456c60..41f322881 100644 --- a/backend/src/app/rpc/queries/profile.clj +++ b/backend/src/app/rpc/queries/profile.clj @@ -92,12 +92,16 @@ profile)) +(def ^:private sql:profile-by-email + "select p.* from profile as p + where p.email = ? + and (p.deleted_at is null or + p.deleted_at > now())") + (defn retrieve-profile-data-by-email [conn email] - (try - (db/get-by-params conn :profile {:email (str/lower email) - :deleted-at nil}) - (catch Exception _e))) + (ex/ignoring + (db/exec-one! conn [sql:profile-by-email (str/lower email)]))) ;; --- Attrs Helpers