Skip to content

Commit 7e63b82

Browse files
committed
Abort ask_project_name if the user didn't load projects
1 parent 6260db2 commit 7e63b82

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/pycamp_bot/commands/projects.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,13 @@ async def ask_project_name(update, context):
223223

224224
projects = Project.select().join(Pycampista).where(Pycampista.username == username)
225225

226+
if not projects:
227+
await context.bot.send_message(
228+
chat_id=update.message.chat_id,
229+
text="No cargaste ningún proyecto",
230+
)
231+
return ConversationHandler.END
232+
226233
keyboard = []
227234
for project in projects:
228235
keyboard.append([InlineKeyboardButton(project.name, callback_data=f"{PROJECT_NAME_PATTERN}:{project.name}")])

0 commit comments

Comments
 (0)