06/16 Phase 6 foundation: admin blueprint, audit log, user management

Adds the admin backend foundation: AuditLog + Setting models/migration,
an admin-only dashboard with KPI cards, and user management (search,
ban/suspend/activate, tier override, trust adjust) with audit logging
on every write action. Smoke suite extended to 64 checks.
This commit is contained in:
2026-06-16 11:45:00 -04:00
parent 62b04803ad
commit 2e9025fe55
18 changed files with 680 additions and 1 deletions
+16
View File
@@ -0,0 +1,16 @@
"""Admin-editable runtime settings (registration_open, flag_threshold, etc.)."""
from datetime import datetime
from sqlalchemy import JSON
from app.extensions import db
class Setting(db.Model):
__tablename__ = "settings"
key = db.Column(db.String(80), primary_key=True)
value = db.Column(JSON, nullable=True)
updated_at = db.Column(db.DateTime, default=datetime.utcnow,
onupdate=datetime.utcnow, nullable=False)
def __repr__(self):
return f"<Setting {self.key}>"