aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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()