Skip to content

Commit 7fb349c

Browse files
committed
exclude segmentation tags from OS auto-tagging
1 parent 3ad63e4 commit 7fb349c

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

kitsune/questions/models.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -306,10 +306,10 @@ def handle_metadata_tags(self, action):
306306
tags.append("Firefox %s" % version)
307307
tags.append("beta")
308308

309-
# Add a tag for the OS but only if it already exists as a tag.
309+
# Add a tag for the OS but only if it already exists as a non-segmentation tag.
310310
if os := self.metadata.get("os"):
311311
try:
312-
os_tag = SumoTag.objects.get(name__iexact=os)
312+
os_tag = SumoTag.objects.non_segmentation_tags().filter(name__iexact=os).get()
313313
except SumoTag.DoesNotExist:
314314
pass
315315
else:

kitsune/tags/models.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ class SumoTagManager(models.Manager):
88
def segmentation_tags(self):
99
return self.filter(is_archived=False, slug__startswith="seg-")
1010

11+
def non_segmentation_tags(self):
12+
return self.exclude(slug__startswith="seg-").filter(is_archived=False)
13+
1114
def active(self):
1215
return self.filter(is_archived=False)
1316

0 commit comments

Comments
 (0)