Remove CurrentUser.country.

This was Cloudflare-specific and it was only used for selecting the
currency during user upgrades.
This commit is contained in:
evazion
2022-10-18 18:14:01 -05:00
parent 873c67db58
commit 6a0e553a84
3 changed files with 4 additions and 12 deletions

View File

@@ -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