error messages
This commit is contained in:
parent
f42b7eae57
commit
949cbd6a6c
1 changed files with 13 additions and 8 deletions
|
|
@ -42,16 +42,21 @@ class Admin::UsersController < ApplicationController
|
||||||
user.skip_confirmation!
|
user.skip_confirmation!
|
||||||
person = Person.where("user_id = ?", user.id).first
|
person = Person.where("user_id = ?", user.id).first
|
||||||
person.update_attributes(params[:user][:people])
|
person.update_attributes(params[:user][:people])
|
||||||
redirect_to admin_conference_registrations_path(@conference.short_title)
|
begin
|
||||||
flash[:notice] = "Successfully created new registration for #{person.email}."
|
|
||||||
rescue Exception => e
|
|
||||||
redirect_to(:back, :alert => e.message)
|
|
||||||
return
|
|
||||||
end
|
|
||||||
params[:user][:conferences].each do |r|
|
params[:user][:conferences].each do |r|
|
||||||
registration = person.registrations.new(:conference_id => r)
|
registration = person.registrations.new(:conference_id => r)
|
||||||
registration.save!
|
registration.save!
|
||||||
end
|
end
|
||||||
|
redirect_to admin_conference_registrations_path(@conference.short_title)
|
||||||
|
flash[:notice] = "Successfully created new registration for #{person.email}."
|
||||||
|
rescue Exception => e
|
||||||
|
redirect_to(:back, :alert => "Did not create registration. #{e.message}")
|
||||||
|
return
|
||||||
|
end
|
||||||
|
rescue Exception => e
|
||||||
|
redirect_to(:back, :alert => "Did not create new user/person. #{e.message}")
|
||||||
|
return
|
||||||
|
end
|
||||||
else
|
else
|
||||||
redirect_to(:back, :alert => "Please select at least one conference to register.")
|
redirect_to(:back, :alert => "Please select at least one conference to register.")
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue