left4me/l4d2web/routes
mwiegand bcea450e98
admin: deactivate/activate/delete endpoints for /admin/users
Three new POST endpoints on the existing admin blueprint, all guarded
by @require_admin and CSRF (per the global before_request hook):

  /admin/users/<id>/deactivate  flips active=False (refuses self)
  /admin/users/<id>/activate    flips active=True
  /admin/users/<id>/delete      hard delete with safeties:
    - refuses self-delete
    - refuses delete-of-the-last-admin
    - refuses if the user owns Servers, Blueprints, or custom
      Overlays (operator deletes those first via existing UIs)
    - nulls out Job.user_id (jobs stay as audit trail; FK is nullable)

admin_users.html grows an Active column + an Actions column with the
appropriate button per row (none for self, Deactivate/Activate
toggle, Delete-with-confirmation modal). Modal pattern mirrors
blueprint_detail.html (same modal-close/modal-open data attrs,
csrf_token hidden field).

Refusal responses are 409 with a plain-text body (matches the
blueprint-in-use refusal at blueprint_routes.py:182). No flash
infrastructure introduced; consistent with the rest of the codebase.

All 367 existing tests still pass.
2026-05-10 21:15:52 +02:00
..
__init__.py chore(l4d2): flatten component layout 2026-05-05 23:47:06 +02:00
auth_routes.py auth: reject inactive users at login + invalidate existing sessions 2026-05-10 21:13:31 +02:00
blueprint_routes.py feat(l4d2-web): blueprint rename moves to footer modal — matches overlay/server pattern 2026-05-09 01:37:29 +02:00
files_routes.py feat(files-overlay): user-managed file content as a third overlay type 2026-05-09 18:59:32 +02:00
job_routes.py feat(l4d2-web): managed global map overlays with daily refresh 2026-05-08 08:05:14 +02:00
log_routes.py feat(l4d2-web): server identity by id, name as display label 2026-05-08 19:22:09 +02:00
overlay_routes.py feat(files-overlay): user-managed file content as a third overlay type 2026-05-09 18:59:32 +02:00
page_routes.py admin: deactivate/activate/delete endpoints for /admin/users 2026-05-10 21:15:52 +02:00
server_routes.py refactor(l4d2-web): detail-page UI — single panel, soft border, footer Delete 2026-05-09 01:26:57 +02:00
workshop_routes.py feat(l4d2-web): per-overlay job list + redirect to job after build-triggering edits 2026-05-08 17:44:22 +02:00