mirror of
https://github.com/openSUSE/osem.git
synced 2026-08-14 20:24:03 +00:00
error messages
This commit is contained in:
parent
f42b7eae57
commit
949cbd6a6c
1 changed files with 13 additions and 8 deletions
|
|
@ -42,15 +42,20 @@ class Admin::UsersController < ApplicationController
|
|||
user.skip_confirmation!
|
||||
person = Person.where("user_id = ?", user.id).first
|
||||
person.update_attributes(params[:user][:people])
|
||||
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 => e.message)
|
||||
begin
|
||||
params[:user][:conferences].each do |r|
|
||||
registration = person.registrations.new(:conference_id => r)
|
||||
registration.save!
|
||||
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
|
||||
params[:user][:conferences].each do |r|
|
||||
registration = person.registrations.new(:conference_id => r)
|
||||
registration.save!
|
||||
end
|
||||
else
|
||||
redirect_to(:back, :alert => "Please select at least one conference to register.")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue