Fixed missing templates in accept invitation action.
This commit is contained in:
parent
22550029b3
commit
80b203a8da
1 changed files with 4 additions and 8 deletions
|
@ -43,13 +43,11 @@ class LoginController < ApplicationController
|
||||||
# For invited users.
|
# For invited users.
|
||||||
def accept_invitation
|
def accept_invitation
|
||||||
@invite = Invite.find_by_token(params[:token])
|
@invite = Invite.find_by_token(params[:token])
|
||||||
if (@invite.nil? || @invite.expires_at < Time.now)
|
if @invite.nil? || @invite.expires_at < Time.now
|
||||||
flash[:error] = "Deine Einladung ist nicht (mehr) gültig."
|
redirect_to login_url, alert: 'Deine Einladung ist nicht (mehr) gültig.'
|
||||||
render :action => 'login'
|
|
||||||
elsif @invite.group.nil?
|
elsif @invite.group.nil?
|
||||||
flash[:error] = "Die Gruppe, in die Du eingeladen wurdest, existiert leider nicht mehr."
|
redirect_to login_url, alert: 'Die Gruppe, in die Du eingeladen wurdest, existiert leider nicht mehr.'
|
||||||
render :action => 'login'
|
elsif request.post?
|
||||||
elsif (request.post?)
|
|
||||||
User.transaction do
|
User.transaction do
|
||||||
@user = User.new(params[:user])
|
@user = User.new(params[:user])
|
||||||
@user.email = @invite.email
|
@user.email = @invite.email
|
||||||
|
@ -62,8 +60,6 @@ class LoginController < ApplicationController
|
||||||
else
|
else
|
||||||
@user = User.new(:email => @invite.email)
|
@user = User.new(:email => @invite.email)
|
||||||
end
|
end
|
||||||
rescue
|
|
||||||
flash[:error] = "Ein Fehler ist aufgetreten. Bitte erneut versuchen."
|
|
||||||
end
|
end
|
||||||
|
|
||||||
protected
|
protected
|
||||||
|
|
Loading…
Reference in a new issue