fix(validation): populate screenshot_paths column + backfill from raw_response

Two bugs preventing screenshot display in report UI:

1. Plugin's ValidationRecord constructor did NOT include
   screenshot_paths (plural, JSON array). The column stayed NULL
   even though paths were stored in raw_response. Records created
   by the plugin now include screenshot_paths=webp_paths|jpeg_paths.

2. Backward compat for existing records: _record_to_dict now
   falls back to extracting screenshot_paths from raw_response JSON
   when the DB column is empty.

Also fixes: broken import statement in validation_service.py
(missing closing paren + missing imports from earlier edit).
This commit is contained in:
2026-06-01 09:05:24 +03:00
parent 79d8d5f7bb
commit 9b2d96786d
2 changed files with 22 additions and 1 deletions

View File

@@ -478,6 +478,7 @@ class DashboardValidationPlugin(PluginBase):
summary=validation_result.summary,
issues=[issue.model_dump() for issue in validation_result.issues],
screenshot_path=validation_result.screenshot_path,
screenshot_paths=webp_paths or jpeg_paths,
raw_response=json.dumps(result_payload, ensure_ascii=False),
)
db.add(db_record)