Commit d05197e1 authored by 李小芳's avatar 李小芳

name

parent 7cf48d2a
...@@ -254,7 +254,7 @@ def get_tractate(pks): ...@@ -254,7 +254,7 @@ def get_tractate(pks):
# 首页精选增加内容分类 明星列表和网红列表 # 首页精选增加内容分类 明星列表和网红列表
tagv4 = tractate.get_tractate_tagv4_names(tractate_id=tractate.id) tagv4 = tractate.get_tractate_tagv4_names(tractate_id=tractate.id)
if tagv4: if tagv4:
tags_info = tractate.get_om_BRAIN_PORTs_info(ids=tagv4) tags_info = tractate.get_om_tags_info(ids=tagv4)
item['selected_stars'] = [] item['selected_stars'] = []
item['selected_internet_celebrity'] = [] item['selected_internet_celebrity'] = []
all_tags = [] all_tags = []
......
...@@ -206,10 +206,4 @@ class TagService(ServiceBase): ...@@ -206,10 +206,4 @@ class TagService(ServiceBase):
recommend_type = stringValue.get("recommend_type") recommend_type = stringValue.get("recommend_type")
all_tags.append({"tag_id": tag_id, "tag_name": tag_name, "tag_type": tag_type, "is_online": is_online, all_tags.append({"tag_id": tag_id, "tag_name": tag_name, "tag_type": tag_type, "is_online": is_online,
"recommend_type": recommend_type}) "recommend_type": recommend_type})
"""
{"id": item.id, "tag_name": item.name, "recommend_type": item.recommend_type,
"tag_type": item.tag_type}
"""
return all_tags return all_tags
...@@ -334,16 +334,16 @@ def diary_update( ...@@ -334,16 +334,16 @@ def diary_update(
first_tag_id = topic_tag_ids[0] first_tag_id = topic_tag_ids[0]
first_tag = TagService.get_tag_by_tag_id(first_tag_id) first_tag = TagService.get_tag_by_tag_id(first_tag_id)
data = { data = {
'tag_id': first_tag.get("id"), 'tag_id': first_tag.get("tag_id"),
'name': first_tag.get("name"), 'name': first_tag.get("tag_name"),
} }
else: else:
diary_tags = diary.tags diary_tags = diary.tags
if diary_tags: if diary_tags:
first_tag = diary_tags[0] first_tag = diary_tags[0]
data = { data = {
'tag_id': first_tag.id, 'tag_id': first_tag.get("tag_id"),
'name': first_tag.name, 'name': first_tag.get("tag_name"),
} }
if draft_id: if draft_id:
......
...@@ -63,7 +63,7 @@ def create_topic( ...@@ -63,7 +63,7 @@ def create_topic(
if topic_type_id not in (TOPIC_TYPE.ASK, TOPIC_TYPE.TOPIC): if topic_type_id not in (TOPIC_TYPE.ASK, TOPIC_TYPE.TOPIC):
return gen(CODES.OPERATION_NOT_SUPPORTED) return gen(CODES.OPERATION_NOT_SUPPORTED)
pure_words = pure_words if pure_words else "" pure_words = pure_words if pure_words else ""
#创建话题时进行敏感词过滤,以前的代码进行了数字的过滤,并只过滤了pure_words部分 本次沿用 # 创建话题时进行敏感词过滤,以前的代码进行了数字的过滤,并只过滤了pure_words部分 本次沿用
filterword_by_custom(filter_type=FILTER_WORD_TYPE.TOPIC_CONTENT, content=pure_words) filterword_by_custom(filter_type=FILTER_WORD_TYPE.TOPIC_CONTENT, content=pure_words)
if not content.strip(): if not content.strip():
...@@ -119,7 +119,7 @@ def create_topic( ...@@ -119,7 +119,7 @@ def create_topic(
if tag_first: if tag_first:
tag_id = tag_first.tag_id tag_id = tag_first.tag_id
tag = TagService.get_tag_by_tag_id(tag_id) tag = TagService.get_tag_by_tag_id(tag_id)
data = {'tag_id': tag.get("id"), 'name': tag.get('name')} data = {'tag_id': tag.get("tag_id"), 'name': tag.get('tag_name')}
else: else:
data = {} data = {}
...@@ -530,7 +530,7 @@ def create_check(content="", is_new_version=False): ...@@ -530,7 +530,7 @@ def create_check(content="", is_new_version=False):
dd = datetime.datetime.now() - datetime.timedelta(seconds=30) dd = datetime.datetime.now() - datetime.timedelta(seconds=30)
user_problems = Problem.objects.filter(user_id=user.id, created_time__gt=dd) user_problems = Problem.objects.filter(user_id=user.id, created_time__gt=dd)
if user_problems and not is_new_version: if user_problems and not is_new_version:
return {'error': 1, 'message': u'为避免恶意发布,请间隔30s后再发'} # TODO 把msg迁移至下游服务? 目前来说是没时间精力... return {'error': 1, 'message': u'为避免恶意发布,请间隔30s后再发'} # TODO 把msg迁移至下游服务? 目前来说是没时间精力...
if not DoctorService.doctor_can_create_topic(user_id=user.id): if not DoctorService.doctor_can_create_topic(user_id=user.id):
return {'error': 1, 'message': u'抱歉,您本周发帖次数已达上限'} return {'error': 1, 'message': u'抱歉,您本周发帖次数已达上限'}
...@@ -686,8 +686,8 @@ def get_topic_count_by_tag_ids(tag_ids, annotate=False): ...@@ -686,8 +686,8 @@ def get_topic_count_by_tag_ids(tag_ids, annotate=False):
@bind('topic/update_video_cover') @bind('topic/update_video_cover')
def update_video_cover(topic_id, video_url, second=0): def update_video_cover(topic_id, video_url, second=0):
cover_url = UploadVideoPicture(url=video_url, second=second) cover_url = UploadVideoPicture(url=video_url, second=second)
video=Video.objects.get(topic_id=topic_id) video = Video.objects.get(topic_id=topic_id)
video.video_pic=cover_url video.video_pic = cover_url
video.save() video.save()
set_water_mark_to_video.delay(video.id) set_water_mark_to_video.delay(video.id)
return {'cover_url': cover_url} return {'cover_url': cover_url}
...@@ -740,8 +740,10 @@ def get_topics_by_ids(ctx, topic_ids): ...@@ -740,8 +740,10 @@ def get_topics_by_ids(ctx, topic_ids):
for diary_id, topic_ids in topic_classify.items(): for diary_id, topic_ids in topic_classify.items():
topic_ids = Problem.objects.filter(diary_id=diary_id).values_list("id", flat=True) topic_ids = Problem.objects.filter(diary_id=diary_id).values_list("id", flat=True)
social_data[diary_id]['vote_count'] = diaries_info[diary_id].get("vote_num", 0) if diaries_info.get(diary_id) else 0 social_data[diary_id]['vote_count'] = diaries_info[diary_id].get("vote_num", 0) if diaries_info.get(
social_data[diary_id]['comment_count'] = diaries_info[diary_id].get("comment_count", 0) if diaries_info.get(diary_id) else 0 diary_id) else 0
social_data[diary_id]['comment_count'] = diaries_info[diary_id].get("comment_count", 0) if diaries_info.get(
diary_id) else 0
social_data[diary_id]['favor_count'] = ProblemFavor.objects.filter(problem_id__in=list(topic_ids), social_data[diary_id]['favor_count'] = ProblemFavor.objects.filter(problem_id__in=list(topic_ids),
is_deleted=False).count() is_deleted=False).count()
......
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