Force new users to fill out their name before trying to register

This commit is contained in:
Matt Barringer 2013-02-06 18:43:10 +01:00
parent 40a283a244
commit 59fe29c1a4

View file

@ -6,7 +6,7 @@ class ConferenceRegistrationController < ApplicationController
@conference = Conference.find_all_by_short_title(params[:id]).first @conference = Conference.find_all_by_short_title(params[:id]).first
@person = current_user.person @person = current_user.person
if @person.first_name.blank? || @person.last_name.blank? if @person.first_name.blank? || @person.last_name.blank?
redirect_to(edit_user_registration, :alert => "Please fill in your first and last name before registering.") redirect_to(edit_user_registration_path, :alert => "Please fill in your first and last name before registering.")
return return
end end
@registration = @person.registrations.where(:conference_id => @conference.id).first @registration = @person.registrations.where(:conference_id => @conference.id).first