(filename: str)
| 1312 | |
| 1313 | @app.route("/tools/screenshot/delete/<path:filename>", methods=["POST"]) |
| 1314 | def tools_delete_screenshot(filename: str): |
| 1315 | path = (SCREENSHOT_DIR / filename).resolve() |
| 1316 | if path.parent == SCREENSHOT_DIR.resolve() and path.exists(): |
| 1317 | try: |
| 1318 | path.unlink() |
| 1319 | flash("Screenshot deleted.") |
| 1320 | except Exception: |
| 1321 | flash("Could not delete screenshot.") |
| 1322 | return redirect(url_for("tools_home")) |
| 1323 | |
| 1324 | # ---------------- routes: browser |
| 1325 | # ---------------- routes: browser ---------------- |
nothing calls this directly
no outgoing calls
no test coverage detected