Fix a minor bug in the project tasgs API call
parent
eb48d72afe
commit
4bfea3567a
|
@ -17,17 +17,6 @@
|
||||||
from contextlib import closing
|
from contextlib import closing
|
||||||
from django.db import connection
|
from django.db import connection
|
||||||
|
|
||||||
def _get_issues_tags(project):
|
|
||||||
extra_sql = ("select unnest(unpickle(tags)) as tagname "
|
|
||||||
"from issues_issue where project_id = %s "
|
|
||||||
"group by unnest(unpickle(tags)) "
|
|
||||||
"order by tagname asc")
|
|
||||||
|
|
||||||
with closing(connection.cursor()) as cursor:
|
|
||||||
cursor.execute(extra_sql, [project.id])
|
|
||||||
rows = cursor.fetchall()
|
|
||||||
|
|
||||||
return set([x[0] for x in rows])
|
|
||||||
|
|
||||||
def _get_stories_tags(project):
|
def _get_stories_tags(project):
|
||||||
extra_sql = ("select unnest(unpickle(tags)) as tagname, count(unnest(unpickle(tags))) "
|
extra_sql = ("select unnest(unpickle(tags)) as tagname, count(unnest(unpickle(tags))) "
|
||||||
|
@ -157,7 +146,7 @@ def get_all_tags(project):
|
||||||
"""
|
"""
|
||||||
|
|
||||||
result = set()
|
result = set()
|
||||||
result.update(_get_issues_tags(project))
|
result.update(x[0] for x in _get_issues_tags(project))
|
||||||
result.update(_get_stories_tags(project))
|
result.update(_get_stories_tags(project))
|
||||||
return sorted(result)
|
return sorted(result)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue