I'm trying to update the data in the table, but for some reason nothing comes out, what could this be related to? Here is my code:
async def save_edit_payment_type(callback_query: types.CallbackQuery, state: FSMContext):
await callback_query.message.edit_reply_markup()
user_data = await state.get_data()
callback_data_payment = callback_query.data
await state.update_data(callback_data_payment=callback_data_payment)
if callback_data_payment == 'cash':
await callback_query.message.answer('Выберите тип:', reply_markup=keyboards.additional_data)
await WaiteEditOrder.waiting_purchase_or_sale_data.set()
else:
order = Order.get(id=user_data["index"])
order.update(
payment_type=callback_data_payment,
purchase_or_sale='',
amount_to_be_paid=0,
)
order.save()
await state.finish()