From dbae9f603a7155c8d656e45968a3471c08099251 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?R=C3=A9mi=20PAILHAREY?= <rpailharey@grandlyon.com>
Date: Thu, 18 Aug 2022 07:14:37 +0000
Subject: [PATCH] =?UTF-8?q?Resolve=20"Titre=20par=20d=C3=A9faut=20sur=20la?=
 =?UTF-8?q?=20newsletter"?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 internal/models/monthlyNews.go | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/internal/models/monthlyNews.go b/internal/models/monthlyNews.go
index 5a7ce8e..638df1c 100644
--- a/internal/models/monthlyNews.go
+++ b/internal/models/monthlyNews.go
@@ -90,7 +90,7 @@ func (dh *DataHandler) SaveMonthlyNews(w http.ResponseWriter, r *http.Request) {
 	err = dh.db.Where("year = ? AND month = ?", monthlyNews.Year, monthlyNews.Month).First(&MonthlyNews{}).Error
 
 	// Default title
-	if monthlyNews.Title == "" {
+	if monthlyNews.Title == "" && monthlyNews.Content != "" {
 		monthlyNews.Title = "Les nouveautés du service"
 	}
 
-- 
GitLab