Skip to content

Commit

Permalink
Fix 500 error during tool update
Browse files Browse the repository at this point in the history
  • Loading branch information
yogeshojha committed Jul 29, 2024
1 parent 756b434 commit f7d0a57
Showing 1 changed file with 8 additions and 4 deletions.
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 Medium

Stack trace information
flows to this location and may be exposed to an external user.

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

0 comments on commit f7d0a57

Please sign in to comment.