Commit 9ff71e49 authored by 王浩's avatar 王浩

Merge branch 'haow/pin_crawl' into 'test'

fix code

See merge request alpha/saturn!62
parents d47ce628 582a2898
......@@ -54,6 +54,8 @@ class CreateTopicForBatch(BaseView):
if item.get("location") and item.get("location").get("name"):
tags.append(item.get("location").get("name"))
content = item.get("content")
if not tag_data:
continue
for tag_name, tag_id in tag_data.items():
if tag_name in tags:
alpha_tag = '<topic>{' + '"id":{},"name":"{}"'.format(tag_id, tag_name) + '}</topic>'
......@@ -167,8 +169,9 @@ class CreateTopicForBatch(BaseView):
item["is_online"] = is_online
item["pictorial_tag_ids"] = pictorial_tag_ids
if item.get("location") and item.get("location").get("name"):
_tag_error, _location_tag_data = self.batch_create_tags(tags=tags, is_location=1, is_own=1)
location_tags.append(_location_tag_data)
_tag_error, _location_tag_data = self.batch_create_tags(tags=[item.get("location").get("name")], is_location=1, is_own=1)
if _location_tag_data:
location_tags.append(_location_tag_data)
not_exists_ids, topic_list, cache_key = self.check_exist_ids(topics=topics, platform=platform)
......@@ -178,10 +181,14 @@ class CreateTopicForBatch(BaseView):
# 先创建标签
_tag_error, _tag_data = self.batch_create_tags(tags=tags, is_own=1)
if not _tag_data:
_tag_data = {}
# 地域标签
if location_tags:
_tag_data = _tag_data.extend(location_tags)
info_logger.info({'location_tags': location_tags})
for item in location_tags:
_tag_data.update(item)
# 更新发帖
# 处理标签,将文本中的标签处理成现有标签
......
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