Skip to content

Refactor/party split modules#179

Merged
psykzz merged 5 commits into
mainfrom
refactor/party-split-modules
Jun 20, 2026
Merged

Refactor/party split modules#179
psykzz merged 5 commits into
mainfrom
refactor/party-split-modules

Conversation

@psykzz

@psykzz psykzz commented Jun 20, 2026

Copy link
Copy Markdown
Owner

Carries the full party cog refactor series to main.

Contains

PR Issue Change
#174 Closes #171 Delete dead EditPartyModal class (~72 lines)
#175 Closes #167 Extract _make_party + _post_party to remove 3x copy-paste
#176 Closes #172 Simplify RoleSelectionModal placeholder (26 lines → 5)
#177 Closes #168 Extract has_party_permission helper to remove 7x copy-paste
#178 Closes #164 Extract _reply helper to collapse signup_user branching

Validation

All commits validated individually with:

  • python -m py_compile party/helpers.py party/views.py party/party.py — clean
  • flake8 party/ — clean

psykzz added 4 commits June 20, 2026 08:55
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.
…y-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.
…#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.
…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.
@psykzz psykzz force-pushed the refactor/party-split-modules branch from 9e0c162 to 47aed74 Compare June 20, 2026 07:56
…ing (#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.
@psykzz psykzz merged commit 764d20c into main Jun 20, 2026
3 checks passed
@psykzz psykzz deleted the refactor/party-split-modules branch June 20, 2026 09:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment