mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
automatically approve invited users on forum where moderators must approve (keep in mind only moderators can invite)
speed up specs a touch allow invite controller to accept an email in absence of user (cleans up API)
This commit is contained in:
@@ -18,6 +18,7 @@ InviteRedeemer = Struct.new(:invite) do
|
||||
add_to_private_topics_if_invited
|
||||
add_user_to_invited_topics
|
||||
send_welcome_message
|
||||
approve_account_if_needed
|
||||
notify_invitee
|
||||
end
|
||||
|
||||
@@ -66,8 +67,12 @@ InviteRedeemer = Struct.new(:invite) do
|
||||
end
|
||||
end
|
||||
|
||||
def approve_account_if_needed
|
||||
invited_user.approve(invite.invited_by_id, send_email=false)
|
||||
end
|
||||
|
||||
def notify_invitee
|
||||
invite.invited_by.notifications.create(notification_type: Notification.types[:invitee_accepted],
|
||||
data: {display_username: invited_user.username}.to_json)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user