mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
DEV: Refactor location string builders. (#6794)
This commit is contained in:
committed by
Régis Hanol
parent
bd6d482d11
commit
a06d310855
@@ -21,11 +21,7 @@ module UserAuthTokensMixin
|
||||
|
||||
def location
|
||||
ipinfo = DiscourseIpInfo.get(client_ip, locale: I18n.locale)
|
||||
|
||||
location = [ipinfo[:city], ipinfo[:region], ipinfo[:country]].reject { |x| x.blank? }.join(", ")
|
||||
return I18n.t('staff_action_logs.unknown') if location.blank?
|
||||
|
||||
location
|
||||
ipinfo[:location].presence || I18n.t('staff_action_logs.unknown')
|
||||
end
|
||||
|
||||
def browser
|
||||
|
||||
Reference in New Issue
Block a user