gotcha verification

This commit is contained in:
Harry Bomrah 2016-08-04 16:25:40 +08:00
parent df953bda4b
commit 18076d343d
2 changed files with 16 additions and 13 deletions

View File

@ -135,7 +135,7 @@ class SeminarsController < ApplicationController
@signup = SeminarSignup.where(email: params[:seminar_signup][:email], seminar_main_id: params[:seminar_signup][:seminar_main_id] ).first @signup = SeminarSignup.where(email: params[:seminar_signup][:email], seminar_main_id: params[:seminar_signup][:seminar_main_id] ).first
@seminar_signup = SeminarSignup.new(seminar_signup_params) @seminar_signup = SeminarSignup.new(seminar_signup_params)
if gotcha_valid?
if @signup.blank? && @seminar_signup.save if @signup.blank? && @seminar_signup.save
# if gotcha_valid? && @seminar_signup.save # if gotcha_valid? && @seminar_signup.save
@ -154,6 +154,9 @@ class SeminarsController < ApplicationController
redirect_to "#{params[:referer_url]}", :notice => t('recaptcha.errors.verification_failed') redirect_to "#{params[:referer_url]}", :notice => t('recaptcha.errors.verification_failed')
end end
end end
else
redirect_to "#{params[:referer_url]}", :notice => t('recaptcha.errors.verification_failed')
end
end end

View File

@ -158,7 +158,7 @@ class SeminarSignupValue
@seminar_signup_field_value.update(field_value_param) rescue nil @seminar_signup_field_value.update(field_value_param) rescue nil
@seminar_signup_field_value.save rescue nil @seminar_signup_field_value.save rescue nil
else else
@seminar_signup_field_value = member.seminar_signup_values.build(field_value_param) #rescue nil @seminar_signup_field_value = member.seminar_signup_values.build(field_value_param) rescue nil
@seminar_signup_field_value.save @seminar_signup_field_value.save
end end
return @seminar_signup_field_value return @seminar_signup_field_value