Skip to content
This repository has been archived by the owner on May 23, 2023. It is now read-only.

Commit

Permalink
Merge pull request #249 from Bidaya0/main
Browse files Browse the repository at this point in the history
fix agent download bug
  • Loading branch information
Bidaya0 authored Nov 23, 2021
2 parents a63a55e + 6826666 commit 1696a40
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions iast/views/agent_download.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from rest_framework.authtoken.models import Token
from django.utils.translation import gettext_lazy as _
from dongtai.models.profile import IastProfile

from iast.utils import get_openapi


logger = logging.getLogger('dongtai-webapi')
Expand Down Expand Up @@ -55,9 +55,7 @@ def get(self, request):
project_name = request.query_params.get('projectName', 'Demo Project')
token, success = Token.objects.values('key').get_or_create(user=request.user)
AGENT_SERVER_PROXY={'HOST':''}
APISERVER = IastProfile.objects.filter(key='apiserver').values_list('value',
flat=True).first()
AGENT_SERVER_PROXY['HOST'] = APISERVER if APISERVER is not None else ''
AGENT_SERVER_PROXY['HOST'] = get_openapi()
resp = requests.get(
url=f'{AGENT_SERVER_PROXY["HOST"]}/api/v1/agent/download?url={base_url}&language={language}&projectName={project_name}',
headers={
Expand Down

0 comments on commit 1696a40

Please sign in to comment.