Commit e9bb0edf authored by 段英荣's avatar 段英荣

Merge branch 'duan_filter_have_read' into 'master'

modify bug

See merge request !363
parents 30fa81b9 cb021642
......@@ -206,10 +206,9 @@ class Topic(models.Model):
def get_tag_name_list(self, tag_id_list):
try:
tag_name_list = list()
for i in range(0, len(tag_name_list), 1000):
query_results = Tag.objects.using(settings.SLAVE_DB_NAME).filter(id__in=tag_id_list[i:i + 1000])
for item in query_results:
tag_name_list.append(item)
for i in range(0, len(tag_id_list), 100):
query_terms_list = list(Tag.objects.using(settings.SLAVE_DB_NAME).filter(id__in=tag_id_list[i:i + 100],is_online=True,is_deleted=False).values_list("name",flat=True))
tag_name_list.extend(query_terms_list)
return tag_name_list
except:
logging.error("catch exception,err_msg:%s" % traceback.format_exc())
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment