05/06 Fix Issue's sla, and others

This commit is contained in:
2026-05-06 11:30:42 -04:00
parent a9678cf994
commit 830bb51f24
4 changed files with 72 additions and 7 deletions
+8 -2
View File
@@ -196,6 +196,12 @@ def view(issue_id):
issue.sla_notified = None # clear so alerts fire again if re-opened
elif form.status.data != 'resolved':
issue.resolved_at = None
# Reset SLA notification state whenever re-opening from resolved so
# the SLA cron re-evaluates from scratch and fires fresh alerts.
# Without this, sla_notified retains its previous 'at_risk'/'breached'
# value and the cron skips the issue indefinitely.
if old_status == 'resolved':
issue.sla_notified = None
issue.result_notes = form.result_notes.data or None
@@ -552,8 +558,8 @@ def request_verification(issue_id):
flash('Access denied.', 'danger')
return redirect(url_for('issues.view', issue_id=issue_id))
if issue.status not in ('in_progress', 'resolved'):
flash('Issue must be in progress or resolved to request verification.', 'warning')
if issue.status not in ('in_progress',):
flash('Issue must be in progress to request verification.', 'warning')
return redirect(url_for('issues.view', issue_id=issue_id))
issue.status = 'pending_verification'