Commit 0ea216e7 authored by Kaspar Vollenweider's avatar Kaspar Vollenweider 👻 Committed by Kaspar
Browse files

accepting an external volunteer won't try to create a user

parent 1fd85553
......@@ -72,7 +72,12 @@ class VolunteersController < ApplicationController
end
def invite_volunteer_user
User.new_volunteer(@volunteer) && @volunteer.user.invite!
return false if @volunteer.external
new_user = User.new(
email: @volunteer.contact.primary_email, password: Devise.friendly_token,
role: 'volunteer', volunteer: @volunteer
)
new_user.save && new_user.invite!
end
def set_volunteer
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment