Repository navigation
fix(admin): warn when inviting to an event or workshop that is not invitable - #3047
Open
costajohnt wants to merge 1 commit into
Open
costajohnt wants to merge 1 commit into
costajohnt wants to merge 1 commit into
Conversation
…vitable Admin::EventsController#invite and Admin::WorkshopsController#invite always flashed a success notice. When the event or workshop was not invitable, InvitationManager returned an error string from inside the delayed job, where nobody saw it, and sent nothing. Check invitable? in both controllers before enqueueing and show a warning instead. The InvitationManager methods drop their dead string returns but keep a bare guard, so a target that stops being invitable before the job runs still sends nothing. The workshop dispatch moves into a private helper to keep #invite within the method length limit. Fixes codebar#2945
Collaborator
|
Thanks, @costajohnt — this looks good to me. Quick summary of the review (correctness, standards, testing and reliability lenses, plus independent validation of the findings):
Two small, optional notes on the new specs:
No blockers from my side. |
mroderick
approved these changes
Oct 18, 2026
This branch has not been deployed
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 #2945
Admin::EventsController#inviteandAdmin::WorkshopsController#invitenow checkinvitable?before enqueueing. A non-invitable event or workshop redirects back with a warning ("The event is not invitable" / "The workshop is not invitable") and nothing is enqueued. Invitable ones behave as before.The three
InvitationManagermethods drop their string returns, but each keeps a barereturn unless ...invitable?. These methods run throughhandle_asynchronously, so that guard is the only check left when the job actually runs. Keeping it means a target that stops being invitable between the click and the job still sends nothing. Happy to drop it if you'd rather have the controller be the only check.Other notes:
send_workshop_invitationshelper, unchanged, so#invitestays under the 10-line method limit with the new guard.admin.event.not_invitablekey next to the existingadmin.workshop.not_invitable.#invitecontroller specs before.