From cc9dbb761df17d88a846c4ae5253d46ff4b1a398 Mon Sep 17 00:00:00 2001 From: Kevin Lu <6320810+kevinlul@users.noreply.github.com> Date: Mon, 11 Nov 2024 23:50:55 -0500 Subject: [PATCH] Don't write out empty string into limit_regulation --- src/job_ocgtcg.py | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/job_ocgtcg.py b/src/job_ocgtcg.py index 362130eac3..4373b074c6 100644 --- a/src/job_ocgtcg.py +++ b/src/job_ocgtcg.py @@ -124,15 +124,11 @@ def annotate_limit_regulation( if ( (release := unreleased.get(document["name"]["en"])) # Exclude The Seal of Orichalcos (UDE promo) and some others - and release.get("OCG status") != "Illegal" - and release.get("TCG status") != "Illegal" + and (ocg := release.get("OCG status")) != "Illegal" + and (tcg := release.get("TCG status")) != "Illegal" ): - document["limit_regulation"]["tcg"] = release.get( - "TCG status", "Not yet released" - ) - document["limit_regulation"]["ocg"] = release.get( - "OCG status", "Not yet released" - ) + document["limit_regulation"]["tcg"] = tcg or "Not yet released" + document["limit_regulation"]["ocg"] = ocg or "Not yet released" if speed := release.get("TCG Speed Duel status"): document["limit_regulation"]["speed"] = speed if (