From 5e7b507b43d857c11c5bb3f757f7b7016f2f30c6 Mon Sep 17 00:00:00 2001 From: pradhamk Date: Sun, 4 Oct 2026 10:49:19 -0400 Subject: [PATCH] Split two-prize sponsor lists into separate tracks Devpost joins exactly two opted-in prizes with " and " and no comma, so tracks() returned them as one merged tag. A comma-free list now splits on " and "; one prize and three-or-more lists parse as before. Co-Authored-By: Claude Opus 5.5 (1M context) --- app/project.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/project.py b/app/project.py index 67658c9..430e7dc 100644 --- a/app/project.py +++ b/app/project.py @@ -73,9 +73,13 @@ def without_project_url(entity: Entity) -> Entity: def tracks(attributes: dict[str, str]) -> list[str]: - # Devpost writes the opted-in prizes as a list: "A, B, and C". - prizes = attributes.get(SPONSOR_PRIZES, "").split(", ") + # Devpost writes the opted-in prizes as a list: "A", "A and B", or + # "A, B, and C". + listed = attributes.get(SPONSOR_PRIZES, "") + prizes = listed.split(", ") if len(prizes) > 1: prizes[-1] = prizes[-1].removeprefix("and ") + else: + prizes = listed.split(" and ") named = [attributes.get(MAIN_TRACK, ""), *prizes] return [track.strip() for track in named if track.strip()]