Skip to content

Commit

Permalink
Merge pull request #608 from Sage-Bionetworks/develop-fix-certificati…
Browse files Browse the repository at this point in the history
…on-failure

More robustly check if a user is certified
  • Loading branch information
afwillia authored Aug 2, 2024
2 parents 3ff9f67 + 3be5aac commit e607c6c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion R/synapse_rest_api.R
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,10 @@ synapse_is_certified <- function(url="https://repo-prod.prod.sagebase.org/repo/v
ownerid <- user_profile[["ownerId"]]
url_req <- file.path(url, ownerid, endpoint)
req <- httr::GET(url_req)
httr::content(req)[["passed"]]
resp <- httr::content(req)
if ("certified" %in% names(resp)) {
return(resp[["certified"]])
} else return(FALSE)

}

Expand Down
5 changes: 4 additions & 1 deletion functions/synapse_rest_api.R
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,10 @@ synapse_is_certified <- function(url="https://repo-prod.prod.sagebase.org/repo/v
ownerid <- user_profile[["ownerId"]]
url_req <- file.path(url, ownerid, endpoint)
req <- httr::GET(url_req)
httr::content(req)[["passed"]]
resp <- httr::content(req)
if ("certified" %in% names(resp)) {
return(resp[["certified"]])
} else return(FALSE)

}

Expand Down

0 comments on commit e607c6c

Please sign in to comment.