Add logging slug to /debug/run_python safe exec call
Codejail logs all calls to `safe_exec` that include a `slug`. Provide a `slug` in the Python-safe-exec debug view so that usages of it are logged (for debugging purposes).
This commit is contained in:
committed by
Kyle McCormick
parent
07b0b71d2d
commit
688d3e7e46
@@ -34,7 +34,12 @@ def run_python(request):
|
||||
py_code = c['code'] = request.POST.get('code')
|
||||
g = {}
|
||||
try:
|
||||
safe_exec(py_code, g, limit_overrides_context="debug_run_python")
|
||||
safe_exec(
|
||||
code=py_code,
|
||||
globals_dict=g,
|
||||
slug="debug_run_python",
|
||||
limit_overrides_context="debug_run_python",
|
||||
)
|
||||
except Exception: # pylint: disable=broad-except
|
||||
c['results'] = traceback.format_exc()
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user