From 6f64602d85cd7333808873ef55b53f144ab255ce Mon Sep 17 00:00:00 2001 From: chrisbr Date: Thu, 9 Apr 2015 10:19:32 +0200 Subject: [PATCH] Redirect to registration edit page when user is already registered --- app/controllers/conference_registrations_controller.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/controllers/conference_registrations_controller.rb b/app/controllers/conference_registrations_controller.rb index b6a616ec..2a48e52a 100644 --- a/app/controllers/conference_registrations_controller.rb +++ b/app/controllers/conference_registrations_controller.rb @@ -5,9 +5,14 @@ class ConferenceRegistrationsController < ApplicationController before_action :set_registration, only: [:edit, :update, :destroy, :show] def new + # Redirect to registration edit when user is already registered + if @conference.user_registered?(current_user) + redirect_to edit_conference_conference_registrations_path(@conference.short_title) + return # ichain does not allow us to create users during registration - if CONFIG['authentication']['ichain']['enabled'] && !current_user + elsif CONFIG['authentication']['ichain']['enabled'] && !current_user redirect_to root_path, alert: 'You need to sign in or sign up before continuing.' + return end @registration = Registration.new @registration.build_user