From 7755bcf668d5c12a6a2d2d4e3f2a1e20c3b7c73b Mon Sep 17 00:00:00 2001
From: Edward Betts <edward@4angle.com>
Date: Fri, 24 Jan 2025 18:43:49 +0000
Subject: [PATCH] Bug fixes

---
 agenda/__init__.py | 5 +++--
 agenda/calendar.py | 2 +-
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/agenda/__init__.py b/agenda/__init__.py
index 43c2283..70701fe 100644
--- a/agenda/__init__.py
+++ b/agenda/__init__.py
@@ -24,7 +24,7 @@ def format_list_with_ampersand(items: list[str]) -> str:
 
 def get_country(alpha_2: str) -> pycountry.db.Country | None:
     """Lookup country by alpha-2 country code."""
-    if alpha_2.count(",") > 10:  # ESA
+    if alpha_2.count(",") > 3:  # ESA
         return pycountry.db.Country(flag="🇪🇺", name="ESA")
     if not alpha_2:
         return None
@@ -33,9 +33,10 @@ def get_country(alpha_2: str) -> pycountry.db.Country | None:
             flag="\U0001F1FD\U0001F1F0", name="Kosovo", alpha_2="xk"
         )
 
-    country: pycountry.db.Country
+    country: pycountry.db.Country = None
     if len(alpha_2) == 2:
         country = pycountry.countries.get(alpha_2=alpha_2.upper())
     elif len(alpha_2) == 3:
         country = pycountry.countries.get(alpha_3=alpha_2.upper())
+
     return country
diff --git a/agenda/calendar.py b/agenda/calendar.py
index d1fb985..bc00d75 100644
--- a/agenda/calendar.py
+++ b/agenda/calendar.py
@@ -45,7 +45,7 @@ def build_events(events: list[Event]) -> list[dict[str, typing.Any]]:
 
             item = {
                 "allDay": False,
-                "title": "checkin: " + e.title,
+                "title": "check-in: " + e.title,
                 "start": e.date.isoformat(),
                 "url": e.url,
             }