Skip to content

Commit

Permalink
synopsis hentet fra reps. Utgjør emnefeltet i sendt e-post. App krasj…
Browse files Browse the repository at this point in the history
…er ved NULL-verdi på subject.
  • Loading branch information
kevinthon committed Jan 22, 2025
1 parent b593b53 commit 8a04e81
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions R/autoReport.R
Original file line number Diff line number Diff line change
Expand Up @@ -556,24 +556,24 @@ runAutoReport <- function(
dato = Sys.Date(),
group = NULL,
type = c("subscription", "dispatchment"),
target = getConfig("rapbaseConfig.yml")$r$autoReport$target,
target = rapbase::getConfig("rapbaseConfig.yml")$r$autoReport$target,
dryRun = FALSE
) {

# get report candidates
reps <- readAutoReportData(target = target) %>%
filterAutoRep(by = "type", pass = type, target = target)
reps <- rapbase::readAutoReportData(target = target) %>%
rapbase::filterAutoRep(by = "type", pass = type, target = target)
if (!is.null(group)) {
reps <- reps %>%
filterAutoRep(by = "package", pass = group, target = target)
rapbase::filterAutoRep(by = "package", pass = group, target = target)

Check warning on line 568 in R/autoReport.R

View check run for this annotation

Codecov / codecov/patch

R/autoReport.R#L568

Added line #L568 was not covered by tests
}
if (target == "db") {
reps <- reps %>%
# nolint start: object_usage_linter
dplyr::summarise(
email = list(unique(email)),
.by = c(owner, ownerName, package, organization, type, fun,
params, startDate, terminateDate, interval)
params, startDate, terminateDate, interval, synopsis)
)
# nolint end
}
Expand Down Expand Up @@ -615,7 +615,7 @@ runAutoReport <- function(
) # 'days', 'weeks', 'months', 'years',
)) {
# get explicit referenced function and call it
f <- .getFun(paste0(rep$package, "::", rep$fun))
f <- rapbase::.getFun(paste0(rep$package, "::", rep$fun))
content <- do.call(what = f, args = params)
if (rep$type == "bulletin") {
text <- content
Expand All @@ -627,7 +627,7 @@ runAutoReport <- function(
if (dryRun) {
message(paste("No emails sent. Content is:", content))
} else {
autLogger(
rapbase::autLogger(

Check warning on line 630 in R/autoReport.R

View check run for this annotation

Codecov / codecov/patch

R/autoReport.R#L630

Added line #L630 was not covered by tests
user = rep$owner,
name = rep$ownerName,
registryName = rep$package,
Expand All @@ -644,7 +644,7 @@ runAutoReport <- function(
)
)
)
sendEmail(
rapbase::sendEmail(

Check warning on line 647 in R/autoReport.R

View check run for this annotation

Codecov / codecov/patch

R/autoReport.R#L647

Added line #L647 was not covered by tests
conf = conf, to = rep$email, subject = rep$synopsis,
text = text, attFile = attFile
)
Expand Down

0 comments on commit 8a04e81

Please sign in to comment.