Add repo-name to DB; better logging for failed repo add

This commit is contained in:
Oskar Thorén 2017-11-10 21:37:53 +00:00
parent 764f60edcb
commit eb8edec116
1 changed files with 8 additions and 6 deletions

View File

@ -263,20 +263,22 @@
:full-repo full-repo :full-repo full-repo
:can-create? can-create?})) :can-create? can-create?}))
(cond (not can-create?) (cond (not can-create?)
{:status 400 (do (log/info "handle-add-repo user not in whitelist: " username)
:body "Please join our Riot - chat.status.im/#/register and request {:status 400
access in our #openbounty room to have your account whitelisted"} :body "Please join our Riot - chat.status.im/#/register and request
access in our #openbounty room to have your account whitelisted"})
(empty? (:address db-user)) (empty? (:address db-user))
{:status 400 (do (log/info "handle-add-repo user lacking ethereum address: " (pr-str db-user))
:body "Please add your ethereum address to your profile first"} {:status 400
:body "Please add your ethereum address to your profile first"})
:else :else
(try (try
(let [_ (log/info "handle-add-repo pre-create") (let [_ (log/info "handle-add-repo pre-create")
db-item (repositories/create db-item (repositories/create
{:id repo-id ;; XXX: Being rename twice... silly. {:id repo-id ;; XXX: Being rename twice... silly.
:name repo ;; XXX: Is this name of repo? :name repo-name ;; XXX: Is this name of repo?
:owner-avatar-url owner-avatar-url :owner-avatar-url owner-avatar-url
:user_id user-id :user_id user-id
:owner owner}) :owner owner})