Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
M
mentha
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
rank
mentha
Commits
d05197e1
Commit
d05197e1
authored
Mar 02, 2021
by
李小芳
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
name
parent
7cf48d2a
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
14 additions
and
18 deletions
+14
-18
transfer.py
data_sync/tractate/transfer.py
+1
-1
tag.py
talos/services/tag.py
+0
-6
update.py
talos/views/diary/update.py
+4
-4
topic.py
talos/views/topic/topic.py
+9
-7
No files found.
data_sync/tractate/transfer.py
View file @
d05197e1
...
...
@@ -254,7 +254,7 @@ def get_tractate(pks):
# 首页精选增加内容分类 明星列表和网红列表
tagv4
=
tractate
.
get_tractate_tagv4_names
(
tractate_id
=
tractate
.
id
)
if
tagv4
:
tags_info
=
tractate
.
get_om_
BRAIN_PORT
s_info
(
ids
=
tagv4
)
tags_info
=
tractate
.
get_om_
tag
s_info
(
ids
=
tagv4
)
item
[
'selected_stars'
]
=
[]
item
[
'selected_internet_celebrity'
]
=
[]
all_tags
=
[]
...
...
talos/services/tag.py
View file @
d05197e1
...
...
@@ -206,10 +206,4 @@ class TagService(ServiceBase):
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
,
"recommend_type"
:
recommend_type
})
"""
{"id": item.id, "tag_name": item.name, "recommend_type": item.recommend_type,
"tag_type": item.tag_type}
"""
return
all_tags
talos/views/diary/update.py
View file @
d05197e1
...
...
@@ -334,16 +334,16 @@ def diary_update(
first_tag_id
=
topic_tag_ids
[
0
]
first_tag
=
TagService
.
get_tag_by_tag_id
(
first_tag_id
)
data
=
{
'tag_id'
:
first_tag
.
get
(
"id"
),
'name'
:
first_tag
.
get
(
"name"
),
'tag_id'
:
first_tag
.
get
(
"
tag_
id"
),
'name'
:
first_tag
.
get
(
"
tag_
name"
),
}
else
:
diary_tags
=
diary
.
tags
if
diary_tags
:
first_tag
=
diary_tags
[
0
]
data
=
{
'tag_id'
:
first_tag
.
id
,
'name'
:
first_tag
.
name
,
'tag_id'
:
first_tag
.
get
(
"tag_id"
)
,
'name'
:
first_tag
.
get
(
"tag_name"
)
,
}
if
draft_id
:
...
...
talos/views/topic/topic.py
View file @
d05197e1
...
...
@@ -63,7 +63,7 @@ def create_topic(
if
topic_type_id
not
in
(
TOPIC_TYPE
.
ASK
,
TOPIC_TYPE
.
TOPIC
):
return
gen
(
CODES
.
OPERATION_NOT_SUPPORTED
)
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
)
if
not
content
.
strip
():
...
...
@@ -119,7 +119,7 @@ def create_topic(
if
tag_first
:
tag_id
=
tag_first
.
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
:
data
=
{}
...
...
@@ -530,7 +530,7 @@ def create_check(content="", is_new_version=False):
dd
=
datetime
.
datetime
.
now
()
-
datetime
.
timedelta
(
seconds
=
30
)
user_problems
=
Problem
.
objects
.
filter
(
user_id
=
user
.
id
,
created_time__gt
=
dd
)
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
):
return
{
'error'
:
1
,
'message'
:
u'抱歉,您本周发帖次数已达上限'
}
...
...
@@ -686,8 +686,8 @@ def get_topic_count_by_tag_ids(tag_ids, annotate=False):
@bind
(
'topic/update_video_cover'
)
def
update_video_cover
(
topic_id
,
video_url
,
second
=
0
):
cover_url
=
UploadVideoPicture
(
url
=
video_url
,
second
=
second
)
video
=
Video
.
objects
.
get
(
topic_id
=
topic_id
)
video
.
video_pic
=
cover_url
video
=
Video
.
objects
.
get
(
topic_id
=
topic_id
)
video
.
video_pic
=
cover_url
video
.
save
()
set_water_mark_to_video
.
delay
(
video
.
id
)
return
{
'cover_url'
:
cover_url
}
...
...
@@ -740,8 +740,10 @@ def get_topics_by_ids(ctx, topic_ids):
for
diary_id
,
topic_ids
in
topic_classify
.
items
():
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
][
'comment_count'
]
=
diaries_info
[
diary_id
]
.
get
(
"comment_count"
,
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
(
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
),
is_deleted
=
False
)
.
count
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment