From ac7b16a5ac02b9a8b4b8c42bcb97f0e27c61ac0c Mon Sep 17 00:00:00 2001 From: Mikhail Kirillov Date: Fri, 11 Oct 2024 02:03:28 +0400 Subject: fixup! Task #30. Allow anyone create or edit upcoming event --- commands/event.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'commands/event.py') diff --git a/commands/event.py b/commands/event.py index 034ce36..b4839ed 100644 --- a/commands/event.py +++ b/commands/event.py @@ -73,7 +73,10 @@ async def create_event( user=last_movie["user"] ) - events[-1] = event_dict + if len(events) > 0: + events[-1] = event_dict + else: + events.append(event_dict) await update.message.reply_text( EVENT_EDITED.format( -- cgit v1.2.3