Skip to content

Commit 78127bf

Browse files
committed
src/consolidate-datacodegouvfr.clj: Reduce owners to organizations
1 parent 4109473 commit 78127bf

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/consolidate-datacodegouvfr.clj

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,13 @@
6060
(when (= 200 (:status res))
6161
(println "Fetching owners data from" url)
6262
(doseq [e (json/parse-string (:body res) true)]
63-
(swap! owners assoc
64-
;; Use lower-case owner URL for keys
65-
(str/lower-case (:owner_url e))
66-
(dissoc e :owner_url))))))
63+
;; Only get organization owners. FIXME: data.code.gouv.fr
64+
;; should only contain those: remove this check?
65+
(when (= (:kind e) "organization")
66+
(swap! owners assoc
67+
;; Use lower-case owner URL for keys
68+
(str/lower-case (:owner_url e))
69+
(dissoc e :owner_url)))))))
6770

6871
;; Get repos
6972
(doseq [{:keys [repositories_url repositories_count kind]} @hosts]

0 commit comments

Comments
 (0)