Fix trip page that crashes when showing Unicode Kosovo flag

Closes: #139
This commit is contained in:
Edward Betts 2024-03-12 15:09:53 +00:00
parent 4ebb08f68e
commit 9d691bee40

View file

@ -32,7 +32,9 @@ def get_country(alpha_2: str) -> pycountry.db.Country | None:
if not alpha_2:
return None
if alpha_2 == "xk":
return pycountry.db.Country(flag="\U0001F1FD\U0001F1F0", name="Kosovo")
return pycountry.db.Country(
flag="\U0001F1FD\U0001F1F0", name="Kosovo", alpha_2="xk"
)
country: pycountry.db.Country
if len(alpha_2) == 2: