Commit 4db1d038 authored by 段英荣's avatar 段英荣

modify bug

parent 9750966e
......@@ -155,7 +155,7 @@ class ESPerform(object):
bulk_actions = []
if sub_index_name=="topic":
if sub_index_name=="topic" or sub_index_name=="topic-star-routing":
for data in data_list:
if data:
bulk_actions.append({
......
......@@ -75,12 +75,19 @@ class Pictorial(models.Model):
def get_effective(self,topic_id_list):
try:
topic_id_list = Topic.objects.filter(id__in=topic_id_list,content_level__in=[3,4,5,0],is_online=True).count()
if topic_id_list >= 5:
return True
else:
return False
effective_num = 0
ret = False
for topic_id in topic_id_list:
topic_id_object = Topic.objects.filter(id=topic_id).first()
if topic_id_object and topic_id_object.is_online and topic_id_object.content_level in (0,3,4,5):
effective_num += 1
if effective_num >= 5:
ret = True
break
return ret
except:
logging.error("catch exception,err_msg:%s" % traceback.format_exc())
return False
......
......@@ -143,8 +143,6 @@ class TypeInfo(object):
))
else:
if data:
data_list.append(data)
if self.type == "topic":
ori_topic_star = redis_client.hget(self.physical_topic_star, data["id"])
if not ori_topic_star:
......@@ -159,6 +157,7 @@ class TypeInfo(object):
data_list.append(old_data)
redis_client.hset(self.physical_topic_star, data["id"], data["content_level"])
data_list.append(data)
# if self.type=="topic" and instance.content_level and int(instance.content_level)>=4:
# topic_data_high_star_list.append(data)
......
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