From 5b8951fe07e8a76cedc27648b63133447c7d7abf Mon Sep 17 00:00:00 2001 From: profitroll Date: Mon, 20 Feb 2023 15:04:24 +0100 Subject: [PATCH] This commit closes #30 --- modules/callbacks/reapply.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/modules/callbacks/reapply.py b/modules/callbacks/reapply.py index 13671f2..390e2ba 100644 --- a/modules/callbacks/reapply.py +++ b/modules/callbacks/reapply.py @@ -116,13 +116,16 @@ async def callback_query_reapply_new(app: Client, clb: CallbackQuery): fullclb = clb.data.split("_") - if HoloUser(clb.from_user).sponsorship_state()[0] == "fill": + holo_user = HoloUser(clb.from_user) + + if holo_user.sponsorship_state()[0] == "fill": await clb.message.reply_text(locale("finish_sponsorship", "message"), quote=False) return await clb.answer(locale("reapply_stopped", "callback", locale=clb.from_user)) message = await app.get_messages(clb.from_user.id, int(fullclb[2])) - col_tmp.update_one({"user": clb.from_user.id}, {"$set": {"state": "fill", "completed": False, "stage": 1}}) + col_tmp.update_one({"user": clb.from_user.id, "type": "application"}, {"$set": {"state": "fill", "completed": False, "stage": 1}}) + holo_user.application_restart(reapply=True) await welcome_pass(app, message, once_again=True) logWrite(f"User {clb.from_user.id} restarted the application after leaving the chat earlier") await clb.message.edit(clb.message.text, reply_markup=InlineKeyboardMarkup([[InlineKeyboardButton(locale("done", "button", locale=clb.from_user), "nothing")]]))