fix(rest,ui): 500 on service pool detail and duplicated Advanced tab outside English - #52
Merged
Merged
Conversation
Commit 4ef7cf2 made DetailHandler.get_item_position abstract, but six subclasses did not implement it. Since DetailHandler is an ABC, those handlers became non-instantiable, raising TypeError on every request and surfacing as "Error 500: Unexpected error" with empty tables in the service pool detail tabs (groups, transports, publications, changelog), the server group detail and the meta pool assigned services. Implemented using the existing calc_item_position helper. Changelog entries are keyed by revision instead of uuid, so position does not apply there and raises InvalidMethodError, matching the base class contract.
REST-side fields (stock fields and GuiBuilder.new_tab) emitted the raw translation marker 'Advanced', while module fields were already translated by gui_description(). On non-english locales the admin UI rendered two separate advanced tabs. Tabs are now translated on build(), on copies, so the static stock field definitions are not modified.
It does not use self nor belongs to the builder public API.
A ModelHandler/DetailHandler subclass missing an @AbstractMethod is not caught at import time: it raises TypeError when the dispatcher instantiates it, surfacing as "Error 500: Unexpected error" with an empty table. That is how the six handlers fixed on 323eac7 broke. Walks the whole subclass tree after the dispatcher registers the handler modules, and fails listing any pending abstract method.
dkmstr
approved these changes
Aug 7, 2026
aschumann-virtualcable
deleted the
master-rest-detail-position-and-gui-tab-i18n
branch
August 7, 2026 14:56
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.
Dos arreglos de la GUI/REST detectados el 2026-08-06, más un test que impide que el primero vuelva.
1.
500al abrir un service pool concreto —fix(rest): implement get_item_position in remaining DetailHandlers(323eac7db)4ef7cf2ffconvirtióget_item_positionen@abstractmethody quitó el cuerpo de la base. SeisDetailHandlerse quedaron sin implementarlo, así que abrir el detalle de un service pool contestaba500y dejaba tres tablas vacías (entre ellas Acciones programadas).Implementado en cada handler, sin tocar la base.
2. Pestaña Advanced duplicada fuera de inglés —
2827f49a2+3dd907fdfGuiBuilderno traducía el nombre del tab, mientras los campos de módulo llegaban ya traducidos porgui_description(). Resultado: en un RDP (directo y túnel) con el admin en español salían dos pestañasAdvanced / Avanzado. Se traduce el tab en la salida del builder y el helper se saca del
GuiBuilder.Se descartó la alternativa de no traducir ningún tab (diff de 2 líneas): mandaría a inglés las 9 del
enum y las custom de módulos (
Security,Ldap info,SMTP Server,Certificates…), que hoy sí salentraducidas.
3. Red de seguridad —
test(rest): assert handlers implement their abstract contract(d3ffc54e3)tests/REST/_meta/test_handler_abstracts.pyrecorre recursivamente el árbol de subclases deDetailHandleryModelHandlery falla listando cualquier clase con__abstractmethods__no vacío.No mira
get_item_positionen concreto: cubre el contrato entero, así que muerde con cualquier@abstractmethodque se añada a las bases en el futuro. Lleva guarda: si el árbol sale vacío, falla envez de pasar en verde sin comprobar nada.
RED comprobado sobre
master(worktree temporal):Las 6 son exactamente las del punto 1. 18 subclases recorridas.
Estado
master(c22d550c2,ort, sin conflictos) → 0 commits por detrás.tests/REST+test_ui_builder.py).Duda para la review
Changelog.get_item_positiones la única que no devuelve unint: haceraise exceptions.rest.InvalidMethodError("Changelog does not support position"). Elraisesale delpropio
4ef7cf2ff, pero unreturn -1encaja mejor con que todos devuelvan número. Es una línea y eltest de abstractos pasa igual con las dos — decidme cuál preferís.
Limitaciones conocidas (no bloquean, quedan anotadas)
build()ya traducidos y se les aplicagettextotra vez. Hoy esidempotente, pero se rompería si un texto traducido coincidiera con un msgid.
services_pools.py:539usa.new_tab(gettext("Availability")), traduciendo en la definición mientrasel resto usa marcadores.
vez de por el literal visible. Toca frontend → otra rama.