From 78c90b01647518c0b88b9c80880354749ade86cc Mon Sep 17 00:00:00 2001 From: Edward Betts Date: Fri, 10 May 2024 10:16:39 +0100 Subject: [PATCH] Bug fix ESA detection --- agenda/__init__.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/agenda/__init__.py b/agenda/__init__.py index 6b69c1e..43c2283 100644 --- a/agenda/__init__.py +++ b/agenda/__init__.py @@ -22,12 +22,9 @@ def format_list_with_ampersand(items: list[str]) -> str: return "" -ESA = "AUT,BEL,CZE,DNK,FIN,FRA,DEU,GRC,IRE,ITA,LUX,NLD,NOR,POL,PRT,ROU,ESP,SWE,CHE,GBR" - - def get_country(alpha_2: str) -> pycountry.db.Country | None: """Lookup country by alpha-2 country code.""" - if alpha_2 == ESA: + if alpha_2.count(",") > 10: # ESA return pycountry.db.Country(flag="🇪🇺", name="ESA") if not alpha_2: return None