                            :project project}))]]
     (assoc user ::follow-count (count (get followings user)))))
 
-(defn invitees
-  "Filters users to invite and returns only fields needed by invitation API"
-  [users]
-  (->> users
-       (filter #(and (:email %)
-                     (:checked %)))
-       (map #(select-keys % [:email :login :id]))
-       (vec)))
+(defn invitees [users-by-login]
+  (->> users-by-login
+       vals
+       (filter (fn [user]
+                 (and (:selected user)
+                      (:email user))))))
 
 (defn invite-teammates-modal [{:keys [selected-org close-fn]} owner]
   (let [select-user! (fn [{:keys [login] :as user}]

                                          (forms/managed-button
                                           [:button.btn.btn-success {:data-success-text "Sent"
                                                                     :on-click #(do
                                                                                  (raise! owner [:invited-github-users {:invitees (invitees users)
                                                                                                                        :vcs_type (:vcs_type selected-org)
                                                                                                                        :org-name (:name selected-org)}])
                                                                                  (close-fn))
                                                                     :disabled (or (empty? (invitees users))
                                                                                   (not (every? #(utils/valid-email? (:email %)) (invitees users))))}
                                            "Send Invites "
                                            [:i.fa.fa-envelope-o]])]
                                :close-fn close-fn})))))))

                               "Invite Teammates")
                             (when show-modal?
                               (om/build invite-teammates-modal {:selected-org (select-keys selected-org [:name :vcs_type :vcs-users])
                                                                 :close-fn #(om/set-state! owner :show-modal? false)}))]}
                (if-let [users (:users selected-org)]
                  (table (add-follow-counts users (:projects selected-org)))
                  (html [:div.loading-spinner common/spinner])))
