From 40a283a24416622b9605125e5f93860730a791f3 Mon Sep 17 00:00:00 2001 From: Matt Barringer Date: Wed, 6 Feb 2013 18:42:12 +0100 Subject: [PATCH] Force new users to fill out their name before trying to register --- app/controllers/conference_registration_controller.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/controllers/conference_registration_controller.rb b/app/controllers/conference_registration_controller.rb index 9beb3019..73bda8fc 100644 --- a/app/controllers/conference_registration_controller.rb +++ b/app/controllers/conference_registration_controller.rb @@ -5,6 +5,10 @@ class ConferenceRegistrationController < ApplicationController # TODO Figure out how to change the route's id from :id to :conference_id @conference = Conference.find_all_by_short_title(params[:id]).first @person = current_user.person + 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.") + return + end @registration = @person.registrations.where(:conference_id => @conference.id).first @registered = true if @registration.nil?