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 ""
|
||||
|
||||
|
||||
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
|
||||
|
|
Loading…
Reference in a new issue