FEATURE: Various improvements to invite system (#12023)

The user interface has been reorganized to show email and link invites
in the same screen. Staff has more control over creating and updating
invites. Bulk invite has also been improved with better explanations.

On the server side, many code paths for email and link invites have
been merged to avoid duplicated logic. The API returns better responses
with more appropriate HTTP status codes.
This commit is contained in:
Dan Ungureanu
2021-03-03 11:45:29 +02:00
committed by GitHub
parent 039d0d3641
commit c047640ad4
37 changed files with 1296 additions and 1092 deletions

View File

@@ -276,10 +276,10 @@ class Wizard
users = JSON.parse(updater.fields[:invite_list])
users.each do |u|
args = {}
args = { email: u['email'] }
args[:moderator] = true if u['role'] == 'moderator'
begin
Invite.create_invite_by_email(u['email'], @wizard.user, args)
Invite.generate(@wizard.user, args)
rescue => e
updater.errors.add(:invite_list, e.message.concat("<br>"))
end