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]
|
||||
params[:registration].delete :supporter_registration_attributes
|
||||
registration = person.registrations.new(params[:registration])
|
||||
if !supporter_reg[:id].blank?
|
||||
# This means that their supporter registration was entered ahead of time, probably by an admin
|
||||
registration.supporter_registration = SupporterRegistration.find(supporter_reg[:id])
|
||||
if registration.supporter_registration.email != person.email
|
||||
raise "Invalid code"
|
||||
if conference.use_supporter_levels? && !supporter_reg.nil?
|
||||
if !supporter_reg[:id].blank?
|
||||
# This means that their supporter registration was entered ahead of time, probably by an admin
|
||||
registration.supporter_registration = SupporterRegistration.find(supporter_reg[:id])
|
||||
if registration.supporter_registration.email != person.email
|
||||
raise "Invalid code"
|
||||
end
|
||||
else
|
||||
registration.supporter_registration = conference.supporter_registrations.new(supporter_reg)
|
||||
end
|
||||
else
|
||||
registration.supporter_registration = conference.supporter_registrations.new(supporter_reg)
|
||||
end
|
||||
|
||||
registration.conference_id = conference.id
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue