MCPcopy Create free account
hub / github.com/dedsec1121fk/DedSec / _discussion_local_cooldown_ok

Function _discussion_local_cooldown_ok

Scripts/ButSystem.py:17359–17367  ·  view source on GitHub ↗

Process-local anti-race throttle for discussion sends.

(username: str, cooldown_s: float = 5.0)

Source from the content-addressed store, hash-verified

17357Args:
17358 username: Parameter.
17359
17360Returns:
17361 Varies.
17362"""
17363 require_admin()
17364 # ensure user exists
17365 conn = db_connect()
17366 exists = conn.execute("SELECT 1 FROM users WHERE username=?", (username,)).fetchone()
17367 conn.close()
17368 if not exists:
17369 flash("User not found.")
17370 return redirect(url_for("admin_panel"))

Callers 1

discussion_sendFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected