Skip to content

Commit

Permalink
Merge pull request #218 from MikiEremiki/develop
Browse files Browse the repository at this point in the history
fix: исправление работы команды reserve_admin
  • Loading branch information
MikiEremiki authored Nov 25, 2024
2 parents b2114fe + 303c0f8 commit 5d542ac
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
10 changes: 4 additions & 6 deletions src/handlers/reserve_admin_hl.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,9 +178,12 @@ async def start_forma_info(
_, callback_data = remove_intent_id(query.data)
base_ticket_id = int(callback_data)

chose_base_ticket, chose_price = await get_ticket_and_price(
context, base_ticket_id)
reserve_user_data = context.user_data['reserve_user_data']

schedule_event_id = reserve_user_data['choose_schedule_event_id']
reserve_user_data['chose_price'] = chose_price
reserve_user_data['chose_base_ticket_id'] = chose_base_ticket.base_ticket_id
reserve_user_data['choose_schedule_event_ids'] = [schedule_event_id]

if 'migration' in context.user_data['command']:
Expand Down Expand Up @@ -224,11 +227,6 @@ async def start_forma_info(
text += '\nСоздаю новые билеты в бд...'
await query.edit_message_text(text)

chose_base_ticket, chose_price = await get_ticket_and_price(
context, base_ticket_id)
reserve_user_data['chose_price'] = chose_price
reserve_user_data['chose_base_ticket_id'] = chose_base_ticket.base_ticket_id

ticket_ids = []
ticket = await db_postgres.create_ticket(
context.session,
Expand Down
7 changes: 4 additions & 3 deletions src/handlers/reserve_hl.py
Original file line number Diff line number Diff line change
Expand Up @@ -594,10 +594,9 @@ async def get_phone(update: Update, context: ContextTypes.DEFAULT_TYPE):
reserve_user_data['message_id'] = message.message_id
return context.user_data['STATE']

base_ticket_id = context.user_data['reserve_user_data'][
'chose_base_ticket_id']
chose_base_ticket_id = reserve_user_data['chose_base_ticket_id']
base_ticket = await db_postgres.get_base_ticket(context.session,
base_ticket_id)
chose_base_ticket_id)
if base_ticket.quality_of_children > 0:
keyboard = [add_btn_back_and_cancel(
postfix_for_cancel=context.user_data['postfix_for_cancel'] + '|',
Expand Down Expand Up @@ -765,6 +764,8 @@ async def get_name_children(
text += '\nПоследняя проверка...'
await message.edit_text(text)
await processing_successful_payment(update, context)
text += '\n\nБилет успешно оформлен.'
await message.edit_text(text)

state = ConversationHandler.END
context.user_data['conv_hl_run'] = False
Expand Down

0 comments on commit 5d542ac

Please sign in to comment.