From ad256f93c5d97f43d30f16fcea3d7cad9d75eb19 Mon Sep 17 00:00:00 2001 From: chiu Date: Fri, 11 Oct 2024 05:15:41 +0000 Subject: [PATCH] Fix email validate. --- app/controllers/asks_controller.rb | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/app/controllers/asks_controller.rb b/app/controllers/asks_controller.rb index d4621d2..692c8a7 100644 --- a/app/controllers/asks_controller.rb +++ b/app/controllers/asks_controller.rb @@ -297,10 +297,8 @@ class AsksController < ApplicationController else referer_url = nil end - if (ask_setting.validate_enable || @must_verify_email) && AskSafeEmail.where(:email=> @ask_question.mail).count == 0 + if @must_verify_email || (ask_setting.validate_enable && AskSafeEmail.where(:email=> @ask_question.mail).count == 0) build_verification_email(@ask_question, referer_url) - elsif @must_verify_email - redirect_to referer_url and return else @ask_question.update(:situation => AskTicketStatus::DefaultKeys[1]) build_email(@ask_question)