mirror of
https://github.com/System-End/identity-vault.git
synced 2026-04-19 19:45:08 +00:00
fix(slack): convert country enum to string for TZInfo lookup
This commit is contained in:
parent
a9bef9d0ff
commit
a02f122c2d
1 changed files with 11 additions and 11 deletions
|
|
@ -315,17 +315,17 @@ module SCIMService
|
|||
end
|
||||
end
|
||||
|
||||
# Fall back to country-based timezone
|
||||
country_code = identity.country
|
||||
if country_code.present?
|
||||
begin
|
||||
country = TZInfo::Country.get(country_code)
|
||||
zone_id = country.zone_identifiers.first
|
||||
return zone_id if zone_id.present?
|
||||
rescue TZInfo::InvalidCountryCode
|
||||
Rails.logger.warn "Invalid country code '#{country_code}' for timezone lookup"
|
||||
end
|
||||
end
|
||||
# Fall back to country-based timezone
|
||||
country_code = identity.country
|
||||
if country_code.present?
|
||||
begin
|
||||
country = TZInfo::Country.get(country_code.to_s)
|
||||
zone_id = country.zone_identifiers.first
|
||||
return zone_id if zone_id.present?
|
||||
rescue TZInfo::InvalidCountryCode
|
||||
Rails.logger.warn "Invalid country code '#{country_code}' for timezone lookup"
|
||||
end
|
||||
end
|
||||
|
||||
nil
|
||||
rescue => e
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue