diff options
author | Max Magorsch <arzano@gentoo.org> | 2020-06-23 18:26:26 +0000 |
---|---|---|
committer | Max Magorsch <arzano@gentoo.org> | 2020-06-23 18:27:04 +0000 |
commit | ead9ec7c9c96dbd6bfc6394df783dd213290efda (patch) | |
tree | 51ff8b048e4f2bb15fba2c1db24d5626e9b91988 | |
parent | Show Author email if name is not available (diff) | |
download | archives-ead9ec7c9c96dbd6bfc6394df783dd213290efda.tar.gz archives-ead9ec7c9c96dbd6bfc6394df783dd213290efda.tar.bz2 archives-ead9ec7c9c96dbd6bfc6394df783dd213290efda.zip |
Hide messages where the date is null
Signed-off-by: Max Magorsch <arzano@gentoo.org>
-rw-r--r-- | pkg/app/home/home.go | 3 | ||||
-rw-r--r-- | pkg/app/popular/utils.go | 1 |
2 files changed, 3 insertions, 1 deletions
diff --git a/pkg/app/home/home.go b/pkg/app/home/home.go index 478fd21..06bd324 100644 --- a/pkg/app/home/home.go +++ b/pkg/app/home/home.go @@ -29,6 +29,7 @@ func ComputeTemplateData() interface{} { var messages []*models.Message database.DBCon.Model(&messages). Where("list = ?", mailingList[0]). + Where("not date is null"). Order("date DESC"). Limit(5). Select() @@ -62,4 +63,4 @@ func ComputeTemplateData() interface{} { MessageCount: formatMessageCount(getAllMessagesCount()), CurrentMonth: time.Now().Format("2006-01"), } -}
\ No newline at end of file +} diff --git a/pkg/app/popular/utils.go b/pkg/app/popular/utils.go index 5af1c2f..66abe3e 100644 --- a/pkg/app/popular/utils.go +++ b/pkg/app/popular/utils.go @@ -25,6 +25,7 @@ func GetPopularThreads(n int, date string) ([]*models.Message, error) { var recentMessages []*models.Message err := database.DBCon.Model(&recentMessages). + Where("not date is null"). OrderExpr("date DESC"). Limit(n). Select() |