fix: swap UserAdmin's unlocked_decks + buds M2M widgets from SelectMultiple to filter_horizontal (dual-listbox). The default SelectMultiple widget renders ALL DeckVariant/User rows in a single listbox with only the currently-selected ones blue-highlighted — visually indistinguishable from "all of these are unlocked" if the reader doesn't notice the highlight state. This cost a half-hour staging bug investigation: Fiorentine Minchiate appeared in the listbox for admin disco and was read as "unlocked", but the Game Kit + Card Decks applets correctly rendered only Earthman because only Earthman was actually in unlocked_decks (Fiorentine was an *available option*, not a selected value). filter_horizontal splits into "Available" (left) + "Chosen" (right) panes with explicit arrows between — selected vs available is unambiguous. Same trap applies to buds (also a bare M2M per [[project-deck-contribution-spec]] adjacent note), so fixing both. No model/template/test changes — just the admin widget. UserAdminTest only exercises the changelist (/admin/lyric/user/), not the change form, so no test impact

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Disco DeDisco
2026-05-24 17:05:14 -04:00
parent 92df686d80
commit 8a56ebff2c

View File

@@ -7,6 +7,7 @@ from .models import LoginToken, Token, User
class UserAdmin(admin.ModelAdmin): class UserAdmin(admin.ModelAdmin):
list_display = ["email"] list_display = ["email"]
search_fields = ["email"] search_fields = ["email"]
filter_horizontal = ["unlocked_decks", "buds"]
class TokenAdminForm(forms.ModelForm): class TokenAdminForm(forms.ModelForm):