Bug fix ESA detection
This commit is contained in:
parent
096e0a371e
commit
78c90b0164
|
@ -22,12 +22,9 @@ def format_list_with_ampersand(items: list[str]) -> str:
|
||||||
return ""
|
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:
|
def get_country(alpha_2: str) -> pycountry.db.Country | None:
|
||||||
"""Lookup country by alpha-2 country code."""
|
"""Lookup country by alpha-2 country code."""
|
||||||
if alpha_2 == ESA:
|
if alpha_2.count(",") > 10: # ESA
|
||||||
return pycountry.db.Country(flag="🇪🇺", name="ESA")
|
return pycountry.db.Country(flag="🇪🇺", name="ESA")
|
||||||
if not alpha_2:
|
if not alpha_2:
|
||||||
return None
|
return None
|
||||||
|
|
Loading…
Reference in a new issue