You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
InvitationManager silently no-ops on non-invitable events/workshops while controllers flash success #2945
Three InvitationManager methods guard with error strings — send_event_emails, send_workshop_emails, send_virtual_workshop_emails all return 'The X is not invitable' unless x.invitable?. All three run via handle_asynchronously, so the return value is discarded by the DelayedJob worker. The controllers (Admin::WorkshopsController#invite, Admin::EventsController#invite) ignore the return anyway and flash "Invitations will be emailed out soon." unconditionally.
Net effect: when the target isn't invitable, nothing is sent and nobody learns — the flash lies.
Proposed change
Check invitable? in the controllers before enqueueing and flash a warning instead of the success message when it's false. (Raising inside the async method can't fix the flash — the raise happens after the redirect.)
Remove the now-dead string returns from InvitationManager; the internal batch-abort strings (start_invitation_batch → return result if result.is_a?(String)) may stay as internal control flow — implementer's call.
Acceptance
Inviting to a non-invitable event/workshop shows a warning flash and enqueues nothing.
Activity