More robust get tags

remotes/origin/enhancement/email-actions
Jesús Espino 2014-08-11 12:33:13 +02:00
parent e1ea8d498c
commit 000baf41d9
2 changed files with 7 additions and 2 deletions

View File

@ -21,6 +21,7 @@ from django.db import connection
def _get_stories_tags(project):
result = set()
for tags in project.user_stories.values_list("tags", flat=True):
if tags:
result.update(tags)
return result
@ -28,6 +29,7 @@ def _get_stories_tags(project):
def _get_issues_tags(project):
result = set()
for tags in project.issues.values_list("tags", flat=True):
if tags:
result.update(tags)
return result

View File

@ -39,6 +39,9 @@ def remove_unused_tags(project):
def update_project_tags_colors_handler(instance):
if instance.tags is None:
instance.tags = []
for tag in instance.tags:
defined_tags = map(lambda x: x[0], instance.project.tags_colors)
if tag not in defined_tags: