From 69f2a7380c8cb7ac35eeeef0ffbf276bcf97dedf Mon Sep 17 00:00:00 2001 From: Teemu Patja Date: Wed, 1 Nov 2017 16:26:26 +0200 Subject: [PATCH] Make hubspot contact creation configurable --- src/clj/commiteth/routes/redirect.clj | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/clj/commiteth/routes/redirect.clj b/src/clj/commiteth/routes/redirect.clj index f006f9c..1560aa0 100644 --- a/src/clj/commiteth/routes/redirect.clj +++ b/src/clj/commiteth/routes/redirect.clj @@ -12,6 +12,8 @@ [clojure.string :as str])) +(defn hubspot-contact-create-enabled [] + (env :hubspot-contact-create-enabled false)) (defn- create-user [token user] (let [{name :name @@ -47,7 +49,8 @@ new-user? (nil? (users/get-user (:id gh-user 0))) user (assoc (get-or-create-user access-token) token-key access-token)] - (when new-user? + (when (and (hubspot-contact-create-enabled) + new-user?) (try (hubspot/create-hubspot-contact (:email user) (:name user "")