Skip to content

Commit

Permalink
Add check to see it the report paths exist
Browse files Browse the repository at this point in the history
  • Loading branch information
aanil committed Jan 17, 2025
1 parent f9a015b commit 62b387b
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions status/reports.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,15 +144,16 @@ def get_sample_summary_report(app, project_id, sample_id=None):

else:
reports = []
for item in os.listdir(sample_summary_reports_path):
if os.path.isdir(
os.path.join(sample_summary_reports_path, item)
) and item.startswith(f"{project_id}_"):
if os.path.exists(
os.path.join(
sample_summary_reports_path, item, f"{item}_report.pdf"
)
):
reports.append(item)
if os.path.exists(sample_summary_reports_path):
for item in os.listdir(sample_summary_reports_path):
if os.path.isdir(
os.path.join(sample_summary_reports_path, item)
) and item.startswith(f"{project_id}_"):
if os.path.exists(
os.path.join(
sample_summary_reports_path, item, f"{item}_report.pdf"
)
):
reports.append(item)

return reports

0 comments on commit 62b387b

Please sign in to comment.