Fixed bug related to org owned repos
* store org name as owner instead of logged in user when toggling a repo
This commit is contained in:
parent
f125bd6244
commit
51ccf7ce34
|
@ -14,7 +14,8 @@
|
||||||
[clojure.tools.logging :as log]
|
[clojure.tools.logging :as log]
|
||||||
[commiteth.eth.core :as eth]
|
[commiteth.eth.core :as eth]
|
||||||
[crypto.random :as random]
|
[crypto.random :as random]
|
||||||
[clojure.set :refer [rename-keys]]))
|
[clojure.set :refer [rename-keys]]
|
||||||
|
[clojure.string :as str]))
|
||||||
|
|
||||||
(defn access-error [_ _]
|
(defn access-error [_ _]
|
||||||
(unauthorized {:error "unauthorized"}))
|
(unauthorized {:error "unauthorized"}))
|
||||||
|
@ -66,8 +67,9 @@
|
||||||
{repo-id :id
|
{repo-id :id
|
||||||
full-repo :full_name
|
full-repo :full_name
|
||||||
repo :name} params
|
repo :name} params
|
||||||
|
[owner _] (str/split full-repo #"/")
|
||||||
db-item (repositories/create (merge params {:user_id user-id
|
db-item (repositories/create (merge params {:user_id user-id
|
||||||
:login login}))
|
:login owner}))
|
||||||
is-enabled (= 2 (:state db-item))]
|
is-enabled (= 2 (:state db-item))]
|
||||||
(if is-enabled
|
(if is-enabled
|
||||||
(disable-repo repo-id full-repo (:hook_id db-item) token)
|
(disable-repo repo-id full-repo (:hook_id db-item) token)
|
||||||
|
|
Loading…
Reference in New Issue