Skip to content

Fixes generales - #131

Open
pwqw wants to merge 8 commits into
PyAr:masterfrom
pwqw:fixes
Open

Fixes generales#131
pwqw wants to merge 8 commits into
PyAr:masterfrom
pwqw:fixes

Conversation

@pwqw

@pwqwpwqw commented Feb 17, 2026

Copy link
Copy Markdown

Fixes

🎯 Cambios Principales

ÁreaCambio
VotacionesSe corrige la obtención del username y proyecto en callbacks de votación
Base de DatosSe cambia INNER JOIN a LEFT OUTER JOIN para mostrar todos los proyectos en /mis_proyectos
SchedulerSe agrega await para ejecutar correctamente make_schedule()
LogsSe actualiza logger.warn() a logger.warning() (deprecado en Python 3.10+)
AdminSe añade comando /vote_count para contar votos totales

🐛 Bugs Corregidos

  • División por cero en cálculos del scheduler cuando no hay participantes
  • Votos no registrados por obtención incorrecta de datos en callbacks
  • Proyectos no visibles sin horario asignado
  • Mensajes de error incompletos sin contexto del admin

📊 Estadísticas

  • Archivos modificados: 7
  • Commits: 8
  • Adiciones: 40 líneas
  • Eliminaciones: 18 líneas

botON added 8 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).
@pwqwpwqw mentioned this pull request Feb 17, 2026
@pwqwpwqw mentioned this pull request Apr 23, 2026
@pwqwpwqw changed the title 1. FixesFixes generalesApr 23, 2026
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

@pwqw