F fix bug

pull/22/head
vapao 2020-01-08 19:06:52 +08:00
parent ee568f1e6f
commit f29175308b
1 changed files with 2 additions and 1 deletions

View File

@ -60,7 +60,8 @@ class DeployView(View):
Argument('is_audit', type=bool, default=False) Argument('is_audit', type=bool, default=False)
).parse(request.body) ).parse(request.body)
if error is None: if error is None:
if Deploy.objects.filter(app_id=form.app_id, env_id=form.env_id).exists(): deploy = Deploy.objects.filter(app_id=form.app_id, env_id=form.env_id).first()
if deploy and deploy.id != form.id:
return json_response(error='应用在该环境下已经存在发布配置') return json_response(error='应用在该环境下已经存在发布配置')
form.host_ids = json.dumps(form.host_ids) form.host_ids = json.dumps(form.host_ids)
if form.extend == '1': if form.extend == '1':