diff --git a/internal/models/monthlyReport.go b/internal/models/monthlyReport.go index 7ba6549e6555223363fdb6bab576e6187235b10e..10a57f6cb2e30fcf850c58609b2e11cc7d9fca9c 100644 --- a/internal/models/monthlyReport.go +++ b/internal/models/monthlyReport.go @@ -85,7 +85,7 @@ func (dh *DataHandler) getMonthlyReport(year int, month int) (monthlyReport Mont var mailSubject MailSubject err = dh.sqlClient.Where("year = ? AND month = ?", year, month).First(&mailSubject).Error - if err != nil { + if err != nil || mailSubject.Subject == "" { // Build default object mailSubject.Subject = fmt.Sprintf("[Ecolyo] Votre bilan %s %v", getMonthNameWithPrep(month-1), year) }