diff --git a/app/controllers/user_upgrades_controller.rb b/app/controllers/user_upgrades_controller.rb index ab28ec58b..932df88b4 100644 --- a/app/controllers/user_upgrades_controller.rb +++ b/app/controllers/user_upgrades_controller.rb @@ -5,7 +5,7 @@ class UserUpgradesController < ApplicationController def create @user_upgrade = authorize UserUpgrade.create(recipient: recipient, purchaser: CurrentUser.user, status: "pending", upgrade_type: params[:upgrade_type], payment_processor: params[:payment_processor]) - @country = params[:country] || CurrentUser.country || "US" + @country = params[:country] || "US" @allow_promotion_codes = params[:promo].to_s.truthy? @checkout = @user_upgrade.create_checkout!(country: @country, allow_promotion_codes: @allow_promotion_codes) diff --git a/app/logical/danbooru_logger.rb b/app/logical/danbooru_logger.rb index 475e928d4..aa2bca4dc 100644 --- a/app/logical/danbooru_logger.rb +++ b/app/logical/danbooru_logger.rb @@ -82,7 +82,6 @@ class DanbooruLogger name: user&.name, level: user&.level_string, #ip: request.remote_ip, - #country: CurrentUser.country, #safe_mode: CurrentUser.safe_mode?, #bot: UserAgent.new(request.headers["HTTP_USER_AGENT"]).is_bot?, } diff --git a/app/logical/session_loader.rb b/app/logical/session_loader.rb index 8dc6331e4..97b84f88a 100644 --- a/app/logical/session_loader.rb +++ b/app/logical/session_loader.rb @@ -58,9 +58,9 @@ class SessionLoader # resetting a password from an magic email link) # # Also performs post-load actions, including updating the user's last login - # timestamp, their last used IP, their timezone, their database timeout, their - # country, whether safe mode is enabled, their session cookie, and unbanning - # banned users if their ban is expired. + # timestamp, their last used IP, their timezone, their database timeout, + # whether safe mode is enabled, their session cookie, and unbanning banned + # users if their ban is expired. # # @see ApplicationController#set_current_user # @see CurrentUser @@ -79,7 +79,6 @@ class SessionLoader update_last_logged_in_at update_last_ip_addr set_time_zone - set_country set_safe_mode set_save_data_mode initialize_session_cookies @@ -168,12 +167,6 @@ class SessionLoader Time.zone = CurrentUser.user.time_zone end - # Depends on Cloudflare - # https://support.cloudflare.com/hc/en-us/articles/200168236-Configuring-Cloudflare-IP-Geolocation - def set_country - CurrentUser.country = request.headers["CF-IPCountry"] - end - def set_safe_mode safe_mode = request.host.in?(Danbooru.config.safe_mode_hostnames) || params[:safe_mode].to_s.truthy? || CurrentUser.user.enable_safe_mode? CurrentUser.safe_mode = safe_mode