Merge branch 'sophie' into hugo-shipping-notice

This commit is contained in:
hugo committed 2026-08-17 20:45:01 +08:00
commit 7fafe316e9
7 files changed
+192 -3

No files matched your search

+7 -2
View File
@@ -89,7 +89,12 @@ def _serialize_progress_run(run: ScheduleRun) -> dict:
failed = int(payload.get('failed_count') or 0)
skipped = int(payload.get('skipped_count') or 0)
processed = success + failed + skipped
percent = int(round(processed / total * 100)) if total > 0 else 0
if total > 0:
percent = int(round(processed / total * 100))
elif payload.get('status') == 'success':
percent = 100
else:
percent = 0
percent = max(0, min(percent, 100))
return {
'run_id': payload['id'],
@@ -180,4 +185,4 @@ def workspace_file_check_run_excel(run_id: int):
raise NotFoundError('run_not_found')
if not run.excel_file_data:
raise NotFoundError('excel_not_found')
return send_file(BytesIO(run.excel_file_data), as_attachment=True, download_name=run.excel_file_name or f'{run.run_no}.xlsx', mimetype='application/vnd.openxmlformats-officedocument.spreadsheetml.sheet')
return send_file(BytesIO(run.excel_file_data), as_attachment=True, download_name=run.excel_file_name or f'{run.run_no}.xlsx', mimetype='application/vnd.openxmlformats-officedocument.spreadsheetml.sheet')