From 223d9922e9fa4d32eff4ba626973ad0def819baa Mon Sep 17 00:00:00 2001 From: Gisle Aune Date: Sat, 7 Jul 2018 23:14:17 +0200 Subject: [PATCH] Changed story.ListTags to ignore tags for unlisted stories --- model/story/tag.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/model/story/tag.go b/model/story/tag.go index 517c065..c0408ca 100644 --- a/model/story/tag.go +++ b/model/story/tag.go @@ -21,7 +21,7 @@ func (tag *Tag) Equal(other Tag) bool { // ListTags lists all tags func ListTags() ([]Tag, error) { tags := make([]Tag, 0, 64) - err := storyCollection.Find(bson.M{"tags": bson.M{"$ne": nil}}).Distinct("tags", &tags) + err := storyCollection.Find(bson.M{"listed": true, "tags": bson.M{"$ne": nil}}).Distinct("tags", &tags) sort.Slice(tags, func(i, j int) bool { kindCmp := strings.Compare(tags[i].Kind, tags[j].Kind)