mirror of
https://github.com/openSUSE/osem.git
synced 2026-08-13 19:54:02 +00:00
Registrations should work w/o supporter levels
This commit is contained in:
parent
d6bda2f6dc
commit
c3c8c2df34
1 changed files with 9 additions and 7 deletions
|
|
@ -42,14 +42,16 @@ class ConferenceRegistrationController < ApplicationController
|
||||||
supporter_reg = params[:registration][:supporter_registration_attributes]
|
supporter_reg = params[:registration][:supporter_registration_attributes]
|
||||||
params[:registration].delete :supporter_registration_attributes
|
params[:registration].delete :supporter_registration_attributes
|
||||||
registration = person.registrations.new(params[:registration])
|
registration = person.registrations.new(params[:registration])
|
||||||
if !supporter_reg[:id].blank?
|
if conference.use_supporter_levels? && !supporter_reg.nil?
|
||||||
# This means that their supporter registration was entered ahead of time, probably by an admin
|
if !supporter_reg[:id].blank?
|
||||||
registration.supporter_registration = SupporterRegistration.find(supporter_reg[:id])
|
# This means that their supporter registration was entered ahead of time, probably by an admin
|
||||||
if registration.supporter_registration.email != person.email
|
registration.supporter_registration = SupporterRegistration.find(supporter_reg[:id])
|
||||||
raise "Invalid code"
|
if registration.supporter_registration.email != person.email
|
||||||
|
raise "Invalid code"
|
||||||
|
end
|
||||||
|
else
|
||||||
|
registration.supporter_registration = conference.supporter_registrations.new(supporter_reg)
|
||||||
end
|
end
|
||||||
else
|
|
||||||
registration.supporter_registration = conference.supporter_registrations.new(supporter_reg)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
registration.conference_id = conference.id
|
registration.conference_id = conference.id
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue