Apr 1 2026: clean up code

This commit is contained in:
2026-04-01 13:15:05 -04:00
parent f399537246
commit 093d3a0043
11 changed files with 52 additions and 29 deletions
+4 -2
View File
@@ -3,7 +3,7 @@ import logging
from flask import (Blueprint, jsonify, request, abort,
render_template, redirect, url_for, flash, current_app)
from flask_login import login_required, current_user
from app import db
from app import db, csrf
from app.models.notification import (
Notification, NotificationPreference, ALL_EVENT_TYPES
)
@@ -166,6 +166,7 @@ def preferences():
# ── Digest trigger (called by cron) ───────────────────────────────────────────
@bp.route('/send-digest', methods=['POST'])
@csrf.exempt
def send_digest():
"""Trigger digest email delivery. Protected by a shared secret token.
@@ -198,6 +199,7 @@ def send_digest():
# ── SLA alert trigger (called by cron) ────────────────────────────────────────
@bp.route('/check-sla', methods=['POST'])
@csrf.exempt
def check_sla():
"""Scan all open issues for SLA breaches and dispatch alerts.
@@ -219,4 +221,4 @@ def check_sla():
sent = send_sla_alerts()
logger.info('SLA CHECK TRIGGERED | notifications_sent=%s', sent)
return jsonify({'ok': True, 'notifications_sent': sent})
return jsonify({'ok': True, 'notifications_sent': sent})