Auto-commit local changes before build (2026-01-06 15:21:26)
This commit is contained in:
parent
f736a62ed5
commit
cf4b23b26e
@ -1 +1 @@
|
||||
v20260106-18-Reset
|
||||
v20260106-18-runchecks-popup-objects-fallback
|
||||
|
||||
@ -19,7 +19,16 @@ from .routes_shared import (
|
||||
get_active_role,
|
||||
)
|
||||
from ..database import db
|
||||
from ..models import Customer, Job, JobRun, JobRunReviewEvent, MailMessage, User
|
||||
from ..models import (
|
||||
Customer,
|
||||
Job,
|
||||
JobObject,
|
||||
JobRun,
|
||||
JobRunReviewEvent,
|
||||
MailMessage,
|
||||
MailObject,
|
||||
User,
|
||||
)
|
||||
|
||||
# Grace window for matching real runs to an expected schedule slot.
|
||||
# A run within +/- 1 hour of the inferred schedule time counts as fulfilling the slot.
|
||||
@ -516,6 +525,7 @@ def run_checks_details():
|
||||
has_eml = bool(getattr(msg, "eml_stored_at", None))
|
||||
|
||||
objects_payload = []
|
||||
# Preferred: read persisted objects for this run from run_object_links/customer_objects (Step 2).
|
||||
try:
|
||||
rows = (
|
||||
db.session.execute(
|
||||
@ -546,7 +556,40 @@ def run_checks_details():
|
||||
}
|
||||
)
|
||||
except Exception:
|
||||
objects_payload = []
|
||||
# Fallback for older data / during upgrades
|
||||
try:
|
||||
objects = run.objects.order_by(JobObject.object_name.asc()).all()
|
||||
except Exception:
|
||||
objects = list(run.objects or [])
|
||||
|
||||
for obj in objects:
|
||||
objects_payload.append(
|
||||
{
|
||||
"name": obj.object_name,
|
||||
"type": getattr(obj, "object_type", "") or "",
|
||||
"status": obj.status or "",
|
||||
"error_message": obj.error_message or "",
|
||||
}
|
||||
)
|
||||
|
||||
# If no run-linked objects exist yet, fall back to objects parsed/stored on the mail message.
|
||||
if (not objects_payload) and msg:
|
||||
try:
|
||||
for mo in (
|
||||
MailObject.query.filter_by(mail_message_id=msg.id)
|
||||
.order_by(MailObject.object_name.asc())
|
||||
.all()
|
||||
):
|
||||
objects_payload.append(
|
||||
{
|
||||
"name": mo.object_name or "",
|
||||
"type": mo.object_type or "",
|
||||
"status": mo.status or "",
|
||||
"error_message": mo.error_message or "",
|
||||
}
|
||||
)
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
status_display = run.status or "-"
|
||||
try:
|
||||
|
||||
@ -131,6 +131,14 @@ Removed an incorrectly indented redirect statement so the module loads correctly
|
||||
- Objects with an error message are displayed first, sorted alphabetically by object name.
|
||||
- Remaining objects are displayed below, also sorted alphabetically by object name.
|
||||
|
||||
---
|
||||
|
||||
## v20260106-18-runchecks-popup-objects-fallback
|
||||
|
||||
- Fixed Run Checks modal object list by adding fallbacks when persisted run_object_links are missing.
|
||||
- Added legacy fallback to load objects via JobRun.objects for older data during/after upgrades.
|
||||
- Added mail-based fallback to load objects via MailObject when no run-linked objects exist yet.
|
||||
- Updated imports in routes_run_checks to include JobObject and MailObject used by the fallback logic.
|
||||
================================================================================================================================================
|
||||
## v0.1.16
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user