Skip to content

Commit

Permalink
Merge pull request #359 from kikislater/master
Browse files Browse the repository at this point in the history
Remove unexpected dash from previous PR #352
  • Loading branch information
eblondel authored Sep 6, 2023
2 parents 7a042fb + 1577527 commit 3caad81
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions inst/actions/zen4R_deposit_record.R
Original file line number Diff line number Diff line change
Expand Up @@ -242,12 +242,11 @@ function(action, entity, config){
if(length(accessRights)>0){
accessRight <- accessRights[[1]]$values[[1]]
config$logger.info(sprintf("accessRight Value: '%s'", accessRight))
zenodo_metadata$setAccessRight(accessRight)-
zenodo_metadata$setAccessRight(accessRight)
if ("embargoed" %in% accessRight) {
config$logger.info(sprintf("Embargoed! Looking for embargoed date..."))
# embargoDate <- as.Date(entity$dates[sapply(entity$dates, function(x){tolower(x$key) == "embargo"})][[1]]$values[[1]])
embargoDates <- entity$dates[sapply(entity$dates, function(date){date$key == "embargo"})]
embargoDate <- if(length(embargoDates)>0) embargoDates[[1]]$values[[1]] else config$logger.error(sprintf("Zenodo: 'embargo' not set in entity$dates whereas 'embargoed' is set in entity$rights. Please check your entities !"))
embargoDate <- if(length(embargoDates)>0) embargoDates[[1]]$value else config$logger.error(sprintf("Zenodo: 'embargo' not set in entity$dates whereas 'embargoed' is set in entity$rights. Please check your entities !"))
zenodo_metadata$setEmbargoDate(embargoDate)
}
else if ("restricted" %in% accessRight) {
Expand Down

0 comments on commit 3caad81

Please sign in to comment.