From d39d95ebc91d987350641800d891bd788e335d62 Mon Sep 17 00:00:00 2001 From: Aleksandr Alekseev Date: Wed, 24 May 2023 14:39:23 +0200 Subject: [PATCH 1/2] Fixing PanDA client --- core/panda_client/views.py | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/core/panda_client/views.py b/core/panda_client/views.py index 53c2c15f..f47f4659 100644 --- a/core/panda_client/views.py +++ b/core/panda_client/views.py @@ -22,12 +22,21 @@ def client(request): if auth is not None and ('Authorization' in auth and 'Origin' in auth): if len(request.session['requestParams']) > 0: data = request.session['requestParams'] + + if 'taskID' in data and data['taskID'] is not None: + jeditaskid = data['taskID'] + elif 'taskid' in data and data['taskid'] is not None: + jeditaskid = data['taskid'] + else: + jeditaskid = None + info['text'] ='Error! JeditaskID is none' + ###Finish Task - if data['action'] == 'finishtask' and ('taskID' in data and data['taskID'] is not None): - info['text'] = finish_task(auth=auth, jeditaskid=data['taskID']) + if data['action'] == 'finishtask' and jeditaskid is not None: + info['text'] = finish_task(auth=auth, jeditaskid=jeditaskid) ### Kill Task - elif data['action'] == 'killtask' and ('taskID' in data and data['taskID'] is not None): - info['text'] = kill_task(auth=auth, jeditaskid=data['taskID']) + elif data['action'] == 'killtask' and jeditaskid is not None: + info['text'] = kill_task(auth=auth, jeditaskid=jeditaskid) ### Set debug mode elif data['action'] == 'setdebugmode' and ('pandaid' in data and data['pandaid'] is not None): if ('params' in data and data['params'] is not None): From 3a45d9193deb41577de1f3dfa2c74639d5d6b3e6 Mon Sep 17 00:00:00 2001 From: Aleksandr Alekseev Date: Wed, 24 May 2023 14:40:26 +0200 Subject: [PATCH 2/2] Fixing PanDA client --- core/panda_client/views.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/core/panda_client/views.py b/core/panda_client/views.py index f47f4659..867b2e6d 100644 --- a/core/panda_client/views.py +++ b/core/panda_client/views.py @@ -29,7 +29,6 @@ def client(request): jeditaskid = data['taskid'] else: jeditaskid = None - info['text'] ='Error! JeditaskID is none' ###Finish Task if data['action'] == 'finishtask' and jeditaskid is not None: @@ -53,7 +52,10 @@ def client(request): else: info['redirect'] = 'false' else: - info['text'] = 'Operation error' + if jeditaskid is None: + info['text'] = 'Error! JeditaskID is none' + else: + info['text'] = 'Operation error' else: info['text'] = 'Request body is empty' else: