Skip to content

Commit

Permalink
Merge branch 'alex_dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
Foorth committed May 24, 2023
2 parents 3f856cc + 3a45d91 commit 5b3738e
Showing 1 changed file with 16 additions and 5 deletions.
21 changes: 16 additions & 5 deletions core/panda_client/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,20 @@ 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

###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):
Expand All @@ -44,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:
Expand Down

0 comments on commit 5b3738e

Please sign in to comment.