From fc8b44f144d0b13ce07c8d61ab839375c7ae52de Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Tue, 23 Dec 2025 19:33:41 +0000 Subject: [PATCH] fix: Correct onboarding flow logic to prevent skipping questions --- app/main.py | 14 +------------- app/modules/database.py | 11 ----------- 2 files changed, 1 insertion(+), 24 deletions(-) diff --git a/app/main.py b/app/main.py index 06a7c6e..a3ebd19 100644 --- a/app/main.py +++ b/app/main.py @@ -18,7 +18,7 @@ from telegram.ext import Application, Defaults, CommandHandler, ContextTypes # --- IMPORTAR HABILIDADES --- from modules.flow_builder import load_flows from modules.logger import log_request -from modules.database import chat_id_exists, deregister_user +from modules.database import chat_id_exists # Importar chat_id_exists from modules.ui import main_actions_keyboard from modules.rh_requests import vacaciones_handler, permiso_handler @@ -105,17 +105,6 @@ async def menu_principal(update: Update, context: ContextTypes.DEFAULT_TYPE): ) -async def reset_command(update: Update, context: ContextTypes.DEFAULT_TYPE): - """Permite a un usuario eliminar su registro para reiniciar el flujo.""" - user = update.effective_user - log_request(user.id, user.username, "reset", update.message.text) - - deregister_user(user.id) - await update.message.reply_text("🔄 Tu registro ha sido eliminado. Ahora puedes volver a registrarte.") - # Llamar a menu_principal para mostrar el menú actualizado - await menu_principal(update, context) - - async def post_init(application: Application): # Mantén los comandos rápidos disponibles en el menú de Telegram await application.bot.set_my_commands( @@ -157,7 +146,6 @@ def main(): app.add_handler(CommandHandler("start", menu_principal)) app.add_handler(CommandHandler("help", menu_principal)) app.add_handler(CommandHandler("links", links_menu)) - app.add_handler(CommandHandler("reset", reset_command)) # Handlers de módulos app.add_handler(vacaciones_handler) diff --git a/app/modules/database.py b/app/modules/database.py index 01a2297..248130d 100644 --- a/app/modules/database.py +++ b/app/modules/database.py @@ -29,14 +29,3 @@ def register_user(user_data: dict) -> bool: except Exception as e: logging.error(f"[MockDB] Register error: {e}") return False - - -def deregister_user(chat_id: int) -> bool: - """Mock deregister: removes user from in-memory set.""" - try: - _REGISTERED_USERS.discard(int(chat_id)) - logging.info(f"[MockDB] User {chat_id} deregistered from memory.") - return True - except Exception as e: - logging.error(f"[MockDB] Deregister error: {e}") - return False