Open
Conversation
added 10 commits
February 17, 2026 01:17
- Changed the implementation of the set_as_only_active method to convert the active selection into a list before processing. - Added a conditional check to ensure bulk updates are only called if there are active instances, improving efficiency.
- Updated the method of retrieving the username from the callback query to use `query.from_user.username` for accuracy. - Adjusted the project name retrieval to use `query.message.text` for consistency. - Enhanced project creation logic to associate the project with the user who initiated the vote, ensuring proper ownership in the database.
… set The query used INNER JOIN with Slot, so only projects with an assigned slot were returned. Before running the schedule step all projects have slot=NULL and every vote was excluded. Switched to LEFT OUTER JOIN with Slot and handle the no-slot case by showing a "Sin asignar" section with project name and owner.
Updated the create_slot function to await the make_schedule call, ensuring proper asynchronous execution and preventing potential issues with scheduling operations.
…ction Updated the error message in the schedule_wizards function to include the username of the admin when a BadRequest occurs, ensuring clearer logging and debugging information.
Introduced a new command, vote_count, to tally votes and restricted access to admins using the @admin_needed decorator. This enhances the voting functionality by allowing authorized users to view the total votes cast.
…limbing - Use max(1, total_participants) when computing most_voted_cost to prevent ZeroDivisionError when there are no participants. - Return current_state when neighboors is empty so hill_climbing does not call max() on an empty sequence (e.g. initial state with no projects).
- Updated the `aux_resolve_show_all` function to handle an additional 'futuros' argument, allowing users to view only upcoming slots. - Adjusted the time comparison for future slots to use Argentina's timezone, ensuring accurate scheduling. - Improved user feedback messages for empty agendas, clarifying the options available for viewing the schedule. - Refactored message sending logic to enhance clarity and user experience.
- Revert aux_resolve_show_all parameter to use context instead of update.message. - The Message object does not have the args attribute that the function needs to resolve the schedule parameter (complete/futures). - This resolves the AttributeError that occurred when running /ver_agenda_magx.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🔧 Resumen de Fixes - Rama
fixesUna guía clara de qué errores se corrigieron y cómo, enfocada en lo que el usuario experimenta en el bot.
🎯 Lo más importante primero
/ver_agenda_magxcrasheacontexten lugar deupdate.messageawaitamake_schedule()📅 Cronología de Fixes
1️⃣ Optimización de base de datos
Commit: eefc83b
El problema que resolvió:
Cómo se arregló:
2️⃣ Votos no se registraban bien
Commit: 42d6914
El problema que resolvió:
Cómo se arregló:
query.from_user.username(fuente correcta)query.message.text(fuente correcta)3️⃣ Error en los logs de anuncios
Commit: ad60178
El problema que resolvió:
/anunciosmostraba un error de Python porque usaba un método obsoletowarn()no existe más en Python 3.10+Cómo se arregló:
logger.warn()porlogger.warning()(el nombre correcto)4️⃣ No ves votos en nuevos proyectos ⭐
Commit: 668c545
El problema que resolvió:
/mis_proyectosno mostraba tus proyectos si aún no tenían horario asignadoCómo se arregló:
5️⃣ Schedule no se ejecutaba
Commit: ad57851
El problema que resolvió:
make_schedule()se llamaba pero no se esperaba completamenteCómo se arregló:
awaitantes demake_schedule()6️⃣ Mensajes de error sin contexto
Commit: 5205dc2
El problema que resolvió:
Cómo se arregló:
7️⃣ Nueva funcionalidad: Ver total de votos
Commit: 017f05c
Qué se agregó:
/vote_countpara que los admins vean cuántos votos tiene cada proyecto en totalUtilidad: Los organizadores pueden monitorear el progreso de votación
8️⃣ Crash al calcular horarios⚠️ CRÍTICO
Commit: b7a96b9
El problema que resolvió:
max()sobre lista vacíaCómo se arregló:
total_participantspormax(1, total_participants)para evitar dividir por ceromax()en lista vacía9️⃣ Mejora: Ver solo slots futuros
Commit: ec8d90e
Qué cambió:
/ver_agenda_magxahora entiende dos formas de uso:/ver_agenda_magx→ muestra todos los slots/ver_agenda_magx futuros→ solo los próximos slotsExperiencia: Más control sobre qué horarios ver
🔟 HOTFIX: /ver_agenda_magx crashea 🚨
Commit: f11c886
El problema que resolvió:
/ver_agenda_magxpero introdujo un bugAttributeErrorupdate.messageen lugar decontextupdate.messageno tiene atributo.args(que es donde está el parámetro "futuros")contexttiene.argsCómo se arregló:
contexten lugar deupdate.message/ver_agenda_magxfunciona de nuevo, y ahora con la funcionalidad mejorada📊 Resumen por categoría
🐛 Bugs Críticos (Que reventaban funcionalidad)
b7a96b9- Division by zero en schedulerf11c886-/ver_agenda_magxcrasheaad57851- Schedule no se ejecuta🔄 Bugs de Lógica (Datos incorrectos)
42d6914- Votos no se registraban668c545- No veías tus proyectos en/mis_proyectos📝 Bugs Menores (Errores de código)
ad60178- Error en logging5205dc2- Error message incompleto✨ Mejoras
017f05c- Nuevo comando/vote_countec8d90e- Mejora a/ver_agenda_magx(vista de futuros)eefc83b- Optimización de BD✅ Resultado final
Después de estos 10 commits:
✔️ Votaciones funcionan correctamente
✔️ Ves todos tus proyectos con votos (aunque no tengan horario)
✔️ El scheduler no se cae
✔️
/ver_agenda_magxmuestra slots (completo o solo futuros)✔️ Los logs son claros y útiles
✔️ Los admins pueden contar votos totales
✔️ La base de datos es más eficiente
El bot está mucho más estable y con mejor experiencia de usuario. 🎉