Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
S
sun
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
alpha
sun
Commits
38a7e78f
Commit
38a7e78f
authored
Jul 18, 2019
by
haowang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix code
parent
1f959cb2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
12 deletions
+12
-12
pictorial.py
api/pictorial.py
+6
-6
topic.py
api/topic.py
+6
-6
No files found.
api/pictorial.py
View file @
38a7e78f
...
@@ -153,13 +153,13 @@ class PictorialProductAdd(APIView):
...
@@ -153,13 +153,13 @@ class PictorialProductAdd(APIView):
"""画报添加商品关系"""
"""画报添加商品关系"""
def
post
(
self
,
request
):
def
post
(
self
,
request
):
id
_
=
request
.
POST
.
get
(
'id
'
)
id
s
=
request
.
POST
.
get
(
'ids'
,
'[]
'
)
product_id
=
request
.
POST
.
get
(
'product_id'
)
product_id
=
request
.
POST
.
get
(
'product_id'
)
try
:
try
:
self
.
rpc
[
'venus/sun/pictorial/add_product'
](
id
_
=
id_
,
product_id
=
product_id
)
.
unwrap
()
self
.
rpc
[
'venus/sun/pictorial/add_product'
](
id
s
=
ids
,
product_id
=
product_id
)
.
unwrap
()
except
Exception
as
e
:
except
Exception
as
e
:
error_logger
.
error
(
u'编辑
%
s画报信息失败
%
s'
%
(
id
_
,
e
))
error_logger
.
error
(
u'编辑
%
s画报信息失败
%
s'
%
(
id
s
,
e
))
raise
raise
return
{
return
{
'message'
:
'更新成功'
'message'
:
'更新成功'
...
@@ -170,13 +170,13 @@ class PictorialProductDel(APIView):
...
@@ -170,13 +170,13 @@ class PictorialProductDel(APIView):
"""画报删除商品关系"""
"""画报删除商品关系"""
def
post
(
self
,
request
):
def
post
(
self
,
request
):
id
_
=
request
.
POST
.
get
(
'id'
)
id
s
=
json
.
loads
(
request
.
POST
.
get
(
'ids'
,
'[]'
)
)
product_id
=
request
.
POST
.
get
(
'product_id'
)
product_id
=
request
.
POST
.
get
(
'product_id'
)
try
:
try
:
self
.
rpc
[
'venus/sun/pictorial/del_product'
](
id
_
=
id_
,
product_id
=
product_id
)
.
unwrap
()
self
.
rpc
[
'venus/sun/pictorial/del_product'
](
id
s
=
ids
,
product_id
=
product_id
)
.
unwrap
()
except
Exception
as
e
:
except
Exception
as
e
:
error_logger
.
error
(
u'编辑
%
s画报信息失败
%
s'
%
(
id
_
,
e
))
error_logger
.
error
(
u'编辑
%
s画报信息失败
%
s'
%
(
id
s
,
e
))
raise
raise
return
{
return
{
'message'
:
'更新成功'
'message'
:
'更新成功'
...
...
api/topic.py
View file @
38a7e78f
...
@@ -251,13 +251,13 @@ class TopicProductAdd(APIView):
...
@@ -251,13 +251,13 @@ class TopicProductAdd(APIView):
"""帖子添加商品关系"""
"""帖子添加商品关系"""
def
post
(
self
,
request
):
def
post
(
self
,
request
):
id
_
=
request
.
POST
.
get
(
'id'
)
id
s
=
json
.
loads
(
request
.
POST
.
get
(
'ids'
,
'[]'
)
)
product_id
=
request
.
POST
.
get
(
'product_id'
)
product_id
=
request
.
POST
.
get
(
'product_id'
)
try
:
try
:
self
.
rpc
[
'venus/sun/topic/add_product'
](
id
_
=
id_
,
product_id
=
product_id
)
.
unwrap
()
self
.
rpc
[
'venus/sun/topic/add_product'
](
id
s
=
ids
,
product_id
=
product_id
)
.
unwrap
()
except
Exception
as
e
:
except
Exception
as
e
:
error_logger
.
error
(
u'编辑
%
s帖子信息失败
%
s'
%
(
id
_
,
e
))
error_logger
.
error
(
u'编辑
%
s帖子信息失败
%
s'
%
(
id
s
,
e
))
raise
raise
return
{
return
{
'message'
:
'更新成功'
'message'
:
'更新成功'
...
@@ -268,13 +268,13 @@ class TopicProductDel(APIView):
...
@@ -268,13 +268,13 @@ class TopicProductDel(APIView):
"""帖子删除商品关系"""
"""帖子删除商品关系"""
def
post
(
self
,
request
):
def
post
(
self
,
request
):
id
_
=
request
.
POST
.
get
(
'id'
)
id
s
=
json
.
loads
(
request
.
POST
.
get
(
'ids'
,
'[]'
)
)
product_id
=
request
.
POST
.
get
(
'product_id'
)
product_id
=
request
.
POST
.
get
(
'product_id'
)
try
:
try
:
self
.
rpc
[
'venus/sun/topic/del_product'
](
id
_
=
id_
,
product_id
=
product_id
)
.
unwrap
()
self
.
rpc
[
'venus/sun/topic/del_product'
](
id
s
=
ids
,
product_id
=
product_id
)
.
unwrap
()
except
Exception
as
e
:
except
Exception
as
e
:
error_logger
.
error
(
u'编辑
%
s帖子信息失败
%
s'
%
(
id
_
,
e
))
error_logger
.
error
(
u'编辑
%
s帖子信息失败
%
s'
%
(
id
s
,
e
))
raise
raise
return
{
return
{
'message'
:
'更新成功'
'message'
:
'更新成功'
...
...
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