Skip to content
Snippets Groups Projects
Commit 688d3e7e authored by Kyle McCormick's avatar Kyle McCormick Committed by Kyle McCormick
Browse files

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).
parent 07b0b71d
Branches
Tags
No related merge requests found
......@@ -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:
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment