Skip to content
This repository has been archived by the owner on Apr 20, 2022. It is now read-only.

Commit

Permalink
fix agent_register register twice in some case (#114)
Browse files Browse the repository at this point in the history
* fix agent_register register twice in some case

* fix agent_register register twice in some case
  • Loading branch information
Bidaya0 authored Nov 5, 2021
1 parent 39fe748 commit 87e1811
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 9 deletions.
4 changes: 2 additions & 2 deletions README.MD
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# DongTai-openapi

[![django-project](https://img.shields.io/badge/django%20versions-3.0.3-blue)](https://www.djangoproject.com/)
[![DongTai-project](https://img.shields.io/badge/DongTai%20versions-beta-green)](https://huoxianclub.github.io/LingZhi/)
[![DongTai--openapi](https://img.shields.io/badge/DongTai--openapi-v1.0.5-lightgrey)](https://huoxianclub.github.io/LingZhi/#/doc/tutorial/quickstart)
[![DongTai-project](https://img.shields.io/badge/DongTai%20versions-beta-green)](https://https://github.com/HXSecurity/DongTai)
[![DongTai-openapi](https://img.shields.io/github/v/release/HXSecurity/Dongtai-openapi?label=Dongtai-openapi)](https://github.com/HXSecurity/DongTai-openapi/releases)

[![Deploy DongTai OpenAPI To AWS Test](https://github.com/HXSecurity/DongTai-openapi/actions/workflows/deploy_openapi_to_aws_test.yml/badge.svg)](https://github.com/HXSecurity/DongTai-openapi/actions/workflows/deploy_openapi_to_aws_test.yml)
[![Deploy DongTai OpenAPI To AWS](https://github.com/HXSecurity/DongTai-openapi/actions/workflows/deploy_openapi_to_aws.yml/badge.svg)](https://github.com/HXSecurity/DongTai-openapi/actions/workflows/deploy_openapi_to_aws.yml)
Expand Down
4 changes: 2 additions & 2 deletions README.ZH-CN.MD
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# DongTai-openapi

[![django-project](https://img.shields.io/badge/django%20versions-3.0.3-blue)](https://www.djangoproject.com/)
[![DongTai-project](https://img.shields.io/badge/DongTai%20versions-beta-green)](https://huoxianclub.github.io/LingZhi/)
[![DongTai--openapi](https://img.shields.io/badge/DongTai--openapi-v1.0.5-lightgrey)](https://huoxianclub.github.io/LingZhi/#/doc/tutorial/quickstart)
[![DongTai-project](https://img.shields.io/badge/DongTai%20versions-beta-green)](https://https://github.com/HXSecurity/DongTai)
[![DongTai-openapi](https://img.shields.io/github/v/release/HXSecurity/Dongtai-openapi?label=Dongtai-openapi)](https://github.com/HXSecurity/DongTai-openapi/releases)

[![Deploy DongTai OpenAPI To AWS Test](https://github.com/HXSecurity/DongTai-openapi/actions/workflows/deploy_openapi_to_aws_test.yml/badge.svg)](https://github.com/HXSecurity/DongTai-openapi/actions/workflows/deploy_openapi_to_aws_test.yml)
[![Deploy DongTai OpenAPI To AWS](https://github.com/HXSecurity/DongTai-openapi/actions/workflows/deploy_openapi_to_aws.yml/badge.svg)](https://github.com/HXSecurity/DongTai-openapi/actions/workflows/deploy_openapi_to_aws.yml)
Expand Down
7 changes: 2 additions & 5 deletions apiserver/views/agent_register.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,9 +195,6 @@ def register_server(agent_id, hostname, network, container_name, container_versi
def post(self, request: Request):
try:
param = parse_data(request.read())
print('-'*100)
print(param)
print('-'*100)
token = param.get('name')
language = param.get('language')
version = param.get('version')
Expand Down Expand Up @@ -249,8 +246,8 @@ def post(self, request: Request):
logger.info(
_('auto create project version {}').format(
project_version.id))

if version_created:
if param.get('projectName', None) and param.get(
'projectVersion', None):
agent_id = self.register_agent(token=token,
project_name=project_name,
language=language,
Expand Down

0 comments on commit 87e1811

Please sign in to comment.