Browse Source

fix: playbook FileNotFoundError

pull/13555/head^2
wangruidong 5 months ago committed by w940853815
parent
commit
db243d050e
  1. 2
      apps/ops/api/playbook.py

2
apps/ops/api/playbook.py

@ -94,7 +94,7 @@ class PlaybookFileBrowserAPIView(APIView):
content = f.read()
except UnicodeDecodeError:
content = _('Unsupported file content')
except SuspiciousFileOperation:
except (SuspiciousFileOperation, FileNotFoundError):
raise JMSException(code='invalid_file_path', detail={"msg": _("Invalid file path")})
return Response({'content': content})
else:

Loading…
Cancel
Save