Browse Source

Changed story.ListTags to ignore tags for unlisted stories

1.0
Gisle Aune 7 years ago
parent
commit
223d9922e9
  1. 2
      model/story/tag.go

2
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)

Loading…
Cancel
Save