Skip to content

Commit 76162a4

Browse files
committed
Fix long project name lenght breaking agrega_repositorio/agregar_grupo
1 parent 3da63d3 commit 76162a4

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/pycamp_bot/commands/projects.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ async def ask_project_name(update, context):
283283

284284
keyboard = []
285285
for project in projects:
286-
keyboard.append([InlineKeyboardButton(project.name, callback_data=f"{PROJECT_NAME_PATTERN}:{project.name}")])
286+
keyboard.append([InlineKeyboardButton(project.name, callback_data=f"{PROJECT_NAME_PATTERN}:{project.id}")])
287287
reply_markup = InlineKeyboardMarkup(keyboard)
288288

289289
await context.bot.send_message(
@@ -332,7 +332,7 @@ async def add_repository(update, context):
332332
username = update.message.from_user.username
333333
text = update.message.text
334334

335-
project = Project.select().where(Project.name == current_projects[username]).get()
335+
project = Project.select().where(Project.id == current_projects[username]).get()
336336

337337
project.repository_url = text
338338
project.save()
@@ -349,7 +349,7 @@ async def add_group(update, context):
349349
username = update.message.from_user.username
350350
text = update.message.text
351351

352-
project = Project.select().where(Project.name == current_projects[username]).get()
352+
project = Project.select().where(Project.id == current_projects[username]).get()
353353

354354
project.group_url = text
355355
project.save()

0 commit comments

Comments
 (0)