March 17 2026: Fix bugs

This commit is contained in:
2026-03-17 16:39:15 -04:00
parent 6248c25103
commit 28196b4a03
5 changed files with 51 additions and 13 deletions
+2 -1
View File
@@ -6,6 +6,7 @@ from app.models.audit import AuditLog
from app.models.user import User
from app.utils.decorators import admin_required
from app.utils.audit import log_action, ACTION_DELETE
from app.utils.time_utils import now_eastern
bp = Blueprint('audit', __name__, url_prefix='/audit')
@@ -120,7 +121,7 @@ def purge():
flash('Invalid purge threshold selected.', 'danger')
return redirect(url_for('audit.index'))
cutoff = datetime.utcnow() - timedelta(days=older_than)
cutoff = now_eastern() - timedelta(days=older_than)
deleted = AuditLog.query.filter(AuditLog.created_at < cutoff).delete()
db.session.flush()