Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Fix 500 error during tool update
  • Loading branch information
yogeshojha committed Jul 29, 2024
commit f7d0a57fdd84790b3dfa1f1aa0fec8b39a805b02
12 changes: 8 additions & 4 deletions web/api/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -982,10 +982,14 @@ def get(self, request):
tool_name = tool_name.split('/')[-1]
update_command = 'cd /usr/src/github/' + tool_name + ' && git pull && cd -'

run_command(update_command)
run_command.apply_async(args=(update_command,))
return Response({'status': True, 'message': tool.name + ' updated successfully.'})


try:
run_command(update_command, shell=True)
run_command.apply_async(args=[update_command], kwargs={'shell': True})
return Response({'status': True, 'message': tool.name + ' updated successfully.'})
except Exception as e:
logger.error(str(e))
return Response({'status': False, 'message': str(e)})

Check warning

Code scanning / CodeQL

Information exposure through an exception

[Stack trace information](1) flows to this location and may be exposed to an external user.

class GetExternalToolCurrentVersion(APIView):
def get(self, request):
Expand Down