From 22c7d8f4f52f94414176ff598bbc44785c1c134f Mon Sep 17 00:00:00 2001 From: shokollm <270575765+shokollm@users.noreply.github.com> Date: Sun, 5 Apr 2026 02:08:01 +0000 Subject: [PATCH] fix: define tz variable in cmd_update before using it The cmd_update function was missing the tz = ZoneInfo(timezone_str) conversion. This caused "tz is not defined" error when confirming edits. --- apps/telegram-bot/commands.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/apps/telegram-bot/commands.py b/apps/telegram-bot/commands.py index 7f09b42..e20fb75 100644 --- a/apps/telegram-bot/commands.py +++ b/apps/telegram-bot/commands.py @@ -418,6 +418,11 @@ async def cmd_update(update: Update, ctx: ContextTypes.DEFAULT_TYPE) -> None: room_id = get_room_id(update) timezone_str = BOUNTY_SERVICE.get_timezone(room_id) + try: + tz = ZoneInfo(timezone_str) + except (KeyError, ZoneInfoNotFoundError): + tz = ZoneInfo("UTC") + text, link, due_date_ts, clear_link, clear_date = parse_args(args[1:], timezone_str) if ( not text