Skip to content

refactor(party): extract _reply helper to collapse signup_user branching#178

Merged
psykzz merged 1 commit into
refactor/party-split-modulesfrom
refactor/party-reply-helper
Jun 20, 2026
Merged

refactor(party): extract _reply helper to collapse signup_user branching#178
psykzz merged 1 commit into
refactor/party-split-modulesfrom
refactor/party-reply-helper

Conversation

@psykzz

@psykzz psykzz commented Jun 19, 2026

Copy link
Copy Markdown
Owner

Closes #164

What

signup_user had a disabled_view + deferred 2×2 condition matrix repeated for every response (not-found, role-full, success) = 12 near-duplicate blocks.

The new _reply() helper collapses all four paths into one place. signup_user drops from ~120 lines to ~35.

Validation

  • python -m py_compile party/party.py — clean
  • flake8 party/ --select=F821,E9 — clean

@psykzz psykzz force-pushed the refactor/party-split-modules branch from 9e0c162 to 47aed74 Compare June 20, 2026 07:56
@psykzz psykzz force-pushed the refactor/party-reply-helper branch 2 times, most recently from 74ab476 to 3c09ee9 Compare June 20, 2026 07:59
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 force-pushed the refactor/party-reply-helper branch from 3c09ee9 to 3cd6520 Compare June 20, 2026 08:00
@psykzz psykzz merged commit a267e09 into refactor/party-split-modules Jun 20, 2026
3 checks passed
@psykzz psykzz deleted the refactor/party-reply-helper branch June 20, 2026 08:17
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.
Sign up for free to 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