From 03a8490ea40f108a9f4d6b9555f58bf8f3d4b116 Mon Sep 17 00:00:00 2001 From: Teemu Patja Date: Tue, 14 Nov 2017 20:08:56 +0200 Subject: [PATCH] Fix parsing of repo owner avatar --- src/clj/commiteth/routes/webhooks.clj | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/clj/commiteth/routes/webhooks.clj b/src/clj/commiteth/routes/webhooks.clj index 482c4bd..32997e1 100644 --- a/src/clj/commiteth/routes/webhooks.clj +++ b/src/clj/commiteth/routes/webhooks.clj @@ -295,12 +295,12 @@ (repositories/update-repo repo-id {:state -1}) (internal-server-error)))))) -(defn handle-installation [{:keys [action repositories sender]}] +(defn handle-installation [{:keys [action installation repositories sender]}] ;; TODO(oskarth): Handle other installs, like disable. (when (= action "created") (let [user-id (:id sender) username (:login sender) - owner-avatar-url (:avatar_url sender) + owner-avatar-url (get-in installation [:account :avatar_url]) first-repo (first repositories) can-create? (user-whitelisted? username)] (log/info "handle-installation created" @@ -313,7 +313,7 @@ (handle-add-repo user-id username owner-avatar-url repo can-create?)))) (ok)) -(defn handle-installation-repositories [{:keys [action sender] :as payload}] +(defn handle-installation-repositories [{:keys [action installation sender] :as payload}] ;; TODO(oskarth): Handle other installs, like disable. ;; TODO(oskarth): Also support remove in :repositories_removed ;; TODO(oskarth): Also support case when :repository_selection is all - does it work differently? @@ -321,7 +321,7 @@ (let [repositories (:repositories_added payload) user-id (:id sender) username (:login sender) - owner-avatar-url (:avatar_url sender) + owner-avatar-url (get-in installation [:account :avatar_url]) first-repo (first repositories) can-create? (user-whitelisted? username)] (log/info "handle-installation-integration created"