Commit 6db8bb0e authored by 张永's avatar 张永

Merge branch 'feature/channel_package_zy' into 'test'

修改单个渠道打包条件

See merge request alpha/sun!92
parents 1d0032e0 79377283
......@@ -145,6 +145,12 @@ class Channel(APIView):
if not all([channel_name, url_name, auto_pack, channel_type]):
error_logger.error(u'参数不完整')
return self.write_fail(code=ERROR.ARG_MISS, message='参数不完整')
if channel_id:
channel = self.rpc['venus/sun/channel_build/channel/get'](
id=channel_id
).unwrap()
else:
channel = {}
data = dict()
if channel_name:
data.update({'name': channel_name})
......@@ -162,7 +168,7 @@ class Channel(APIView):
error_logger.error('操作失败%s', e)
return self.write_fail(message='路径名不能重复', code=-1)
version = resp.get('version', '')
if version and not channel_id:
if version and channel.get('url_name') != url_name:
channel_build_one.delay(version, url_name)
return self.write_success(message='操作成功', 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