refactor(party): simplify RoleSelectionModal placeholder truncation (26 lines -> 5)#176
Merged
psykzz merged 1 commit intoJun 20, 2026
Conversation
Closes #172 The 26-line nested conditional block for building a modal placeholder (with dead suffix variable) is replaced with 5 clear lines. Behaviour is identical: prefix + truncated roles list at 100 chars.
psykzz
added a commit
that referenced
this pull request
Jun 20, 2026
* refactor(party): delete dead EditPartyModal class (#174) Closes #171 EditPartyModal (title+description only) was superseded by EditPartyFullModal (all settings). PartyView.edit_button always opens EditPartyFullModal. No references to EditPartyModal exist outside its own definition. * refactor(party): extract _make_party and _post_party to remove 3x copy-paste (#175) Closes #167 Party dict construction and two-step config-write (save -> send -> save IDs) were duplicated in party_create, party_template_use, and CreatePartyModal. _make_party builds the dict; _post_party handles save+send+ID update. * refactor(party): extract has_party_permission to remove 7x copy-paste (#177) Closes #168 The author/admin permission check was copy-pasted in party_description, party_settime, party_compact, party_rename_option, party_delete, PartyView.edit_button, and PartyView.delete_button. Extracted to has_party_permission() in helpers.py to avoid circular import. * refactor(party): simplify RoleSelectionModal placeholder truncation (#176) Closes #172 The 26-line nested conditional block for building a modal placeholder (with dead suffix variable) is replaced with 5 clear lines. Behaviour is identical: prefix + truncated roles list at 100 chars. * refactor(party): extract _reply helper to collapse signup_user branching (#178) Closes #164 signup_user had a disabled_view+deferred 2x2 matrix repeated for every response (not-found, role-full, success) = 12 near-duplicate blocks. Extracted _reply() collapses all paths. signup_user drops ~120->~35 lines.
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.
Closes #172
What
RoleSelectionModal.__init__had 26 lines of nested conditionals to build a modal placeholder string. Thesuffixvariable was always""(inert), andlabelwas always"Your Role"regardless of the branch.Replaced with 5 clear lines. Behaviour is identical.
Validation
python -m py_compile party/views.py— cleanflake8 party/ --select=F821,E9— clean