Skip to content

Commit f7d0a57

Browse files
committed
Fix 500 error during tool update
1 parent 756b434 commit f7d0a57

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

web/api/views.py

+8-4
Original file line numberDiff line numberDiff line change
@@ -982,10 +982,14 @@ def get(self, request):
982982
tool_name = tool_name.split('/')[-1]
983983
update_command = 'cd /usr/src/github/' + tool_name + ' && git pull && cd -'
984984

985-
run_command(update_command)
986-
run_command.apply_async(args=(update_command,))
987-
return Response({'status': True, 'message': tool.name + ' updated successfully.'})
988-
985+
986+
try:
987+
run_command(update_command, shell=True)
988+
run_command.apply_async(args=[update_command], kwargs={'shell': True})
989+
return Response({'status': True, 'message': tool.name + ' updated successfully.'})
990+
except Exception as e:
991+
logger.error(str(e))
992+
return Response({'status': False, 'message': str(e)})
989993

990994
class GetExternalToolCurrentVersion(APIView):
991995
def get(self, request):

0 commit comments

Comments
 (0)