Prevented sending of empty emails
This commit is contained in:
parent
9a0d73ec97
commit
71e4b3399d
@ -285,8 +285,10 @@ class ObservationsController {
|
||||
logger.info("Sending Observation data by email")
|
||||
if (::mailer.isInitialized) {
|
||||
val data = getObservations(observationsRequest)
|
||||
if (data.isEmpty())
|
||||
if (data.isEmpty()) {
|
||||
logger.warn("Email not send, would contain no data")
|
||||
throw ResponseStatusException(HttpStatus.BAD_REQUEST, "Request would send no data.")
|
||||
}
|
||||
mailer.sendObservationData(data)
|
||||
return true
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user