osem
osem copied to clipboard
Invite with roles
Organizers can invite unregistered people to become organizer, cfp, info desk, volunteer coordinator.
At present, we can only assign roles to registered users
If the user with email is not present then a flash appears with message "Could not find user. Please provide a valid email"
So my changes will be to invite people if email doesn't exist, from the roles controller.
Current code: https://github.com/openSUSE/osem/blob/614068874d67c3846902b0d44621e7865073fff4/app/controllers/admin/roles_controller.rb#L65
Changes: `
unless user
User.invite!({ email: user_params[:email] }, current_user) do |user|
user.invitation_message = @role.name + ' of ' + @conference.title
end
user = User.find_by(email: user_params[:email])
unless user
redirect_to url,
error: 'Could not find user. Please provide a valid email!'
return
end
end
`
@rahul2240
So my changes will be to invite people if email doesn't exist, from the roles controller.
as said in your PR, the invite code shouldn't be everywhere duplicated.
In my opinion, you should send the the user an invitation and show the state of the invitation in OSEM.