From 9d691bee40d9fe5dc7f33246322c4861c18fff0f Mon Sep 17 00:00:00 2001 From: Edward Betts Date: Tue, 12 Mar 2024 15:09:53 +0000 Subject: [PATCH] Fix trip page that crashes when showing Unicode Kosovo flag Closes: #139 --- agenda/__init__.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/agenda/__init__.py b/agenda/__init__.py index 80be7d2..866e7e3 100644 --- a/agenda/__init__.py +++ b/agenda/__init__.py @@ -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: