aboutsummaryrefslogtreecommitdiff
path: root/pkg/app
diff options
context:
space:
mode:
authorMax Magorsch <arzano@gentoo.org>2020-06-23 18:26:26 +0000
committerMax Magorsch <arzano@gentoo.org>2020-06-23 18:27:04 +0000
commitead9ec7c9c96dbd6bfc6394df783dd213290efda (patch)
tree51ff8b048e4f2bb15fba2c1db24d5626e9b91988 /pkg/app
parentShow Author email if name is not available (diff)
downloadarchives-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>
Diffstat (limited to 'pkg/app')
-rw-r--r--pkg/app/home/home.go3
-rw-r--r--pkg/app/popular/utils.go1
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()