diff --git a/app/controllers/phone_confirmations/send_sms_controller.rb b/app/controllers/phone_confirmations/send_sms_controller.rb index 1a1a65a15..82b287540 100644 --- a/app/controllers/phone_confirmations/send_sms_controller.rb +++ b/app/controllers/phone_confirmations/send_sms_controller.rb @@ -17,7 +17,7 @@ def create @show_checkbox_recaptcha = true unless @success - redirect_to new_user_phone_confirmation_path(@phone_confirmation.user.uuid), status: :see_other, turbo: false + redirect_to new_user_phone_confirmation_path(@phone_confirmation.user.uuid), status: :see_other end private diff --git a/app/helpers/phone_confirmations_helper.rb b/app/helpers/phone_confirmations_helper.rb index 3c38e0064..a0083894a 100644 --- a/app/helpers/phone_confirmations_helper.rb +++ b/app/helpers/phone_confirmations_helper.rb @@ -1,5 +1,7 @@ module PhoneConfirmationsHelper def render_send_in_button? - Setting.find_by(code: 'require_phone_confirmation').retrieve && current_user.mobile_phone_confirmed_at.nil? && current_user.mobile_phone.present? + Setting.find_by(code: 'require_phone_confirmation').retrieve && + current_user.mobile_phone_confirmed_at.nil? && + current_user.mobile_phone.present? end end diff --git a/app/models/invoice.rb b/app/models/invoice.rb index eaf1d8961..2e77c8b4a 100644 --- a/app/models/invoice.rb +++ b/app/models/invoice.rb @@ -120,6 +120,7 @@ def deposit def recalculate_vat_rate return unless payable? + return if billing_profile_id == billing_profile_id_was self.vat_rate = assign_vat_rate diff --git a/app/models/phone_confirmation.rb b/app/models/phone_confirmation.rb index 1fb4cfdc7..972b1a8cc 100644 --- a/app/models/phone_confirmation.rb +++ b/app/models/phone_confirmation.rb @@ -3,7 +3,7 @@ class PhoneConfirmation attr_reader :user - TIME_LIMIT = 1.minutes + TIME_LIMIT = AuctionCenter::Application.config.customization[:mobile_sms_sent_time_limit_in_minutes] || 1.minutes def initialize(user) @user = user diff --git a/config/customization.yml.sample b/config/customization.yml.sample index 7ca9e653b..01ac5f519 100644 --- a/config/customization.yml.sample +++ b/config/customization.yml.sample @@ -18,7 +18,7 @@ default: &default vapid_public: "BGgFbsalgk-emt7f0f279JsxF15NOfEJKQ-7w04FmXseeWt4pRvCaD7EMl6PqS-BHrwO3QWsPUOGkAjNWNBOVLY=" vapid_private: "2xl1lvaQARjFHRCKrPo2B-MbTAc1IZ3UrfugDh6cJiE=" - mobile_sms_sent_time_limit_in_minutes: 5 + mobile_sms_sent_time_limit_in_minutes: 1 mailer: # Host to which links from emails should redirect to