mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: Resend only pending invites (#13403)
The Resend Invites button used to resend expired invites too, which was unexpected because the button was on the Pending Invites page.
This commit is contained in:
@@ -290,12 +290,8 @@ class InvitesController < ApplicationController
|
||||
def resend_all_invites
|
||||
guardian.ensure_can_resend_all_invites!(current_user)
|
||||
|
||||
Invite
|
||||
.left_outer_joins(:invited_users)
|
||||
.where(invited_by: current_user)
|
||||
Invite.pending(current_user)
|
||||
.where('invites.email IS NOT NULL')
|
||||
.where('invited_users.user_id IS NULL')
|
||||
.group('invites.id')
|
||||
.find_each { |invite| invite.resend_invite }
|
||||
|
||||
render json: success_json
|
||||
|
||||
Reference in New Issue
Block a user