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

Function profiler_delete

Scripts/ButSystem.py:16342–16384  ·  view source on GitHub ↗

Delete a Profiler entry (requires typing first+last name). Requested safety: user must type the profile's first and last name before deletion.

(eid: int)

Source from the content-addressed store, hash-verified

16340 stored_path = os.path.join(ATT_DIR, f"prof_att_{aid}.bin")
16341 try:
16342 size = _save_plain_upload(file_storage, stored_path)
16343 # Keep profiler attachments reasonably bounded to avoid DoS.
16344 if int(size) > CHAT_MAX_BYTES:
16345 try:
16346 os.remove(stored_path)
16347 except Exception:
16348 pass
16349 conn.execute("DELETE FROM profiler_attachments WHERE id=?", (aid,))
16350 conn.commit()
16351 conn.close()
16352 raise ValueError("too_large")
16353 conn.execute("UPDATE profiler_attachments SET stored_path=? WHERE id=?", (stored_path, aid))
16354 conn.commit()
16355 finally:
16356 try:
16357 conn.close()
16358 except Exception:
16359 pass
16360
16361
16362def _bounty_currency_symbol() -> str:
16363 try:
16364 return "€" if get_lang() == "el" else "$"
16365 except Exception:
16366 return "$"
16367
16368def _fmt_bounty_amount_plain(val: Any) -> str:
16369 try:
16370 f = float(val)
16371 except Exception:
16372 return ""
16373 if f.is_integer():
16374 return str(int(f))
16375 s = f"{f:.2f}".rstrip("0").rstrip(".")
16376 return s or "0"
16377
16378def _fmt_bounty_price(val: Any) -> str:
16379 """Format bounty price with localized currency symbol."""
16380 amt = _fmt_bounty_amount_plain(val)
16381 if not amt:
16382 return ""
16383 return f"{_bounty_currency_symbol()}{amt}"
16384
16385def _complete_login_session(username: str, is_admin: bool) -> Response:
16386 # Drop stale session data on successful login while keeping a fresh CSRF token.
16387 try:

Callers

nothing calls this directly

Calls 3

current_userFunction · 0.70
db_connectFunction · 0.70
aesgcm_decrypt_textFunction · 0.70

Tested by

no test coverage detected