summaryrefslogtreecommitdiff
path: root/app/controllers/config_snom_controller.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/controllers/config_snom_controller.rb')
-rw-r--r--app/controllers/config_snom_controller.rb8
1 files changed, 2 insertions, 6 deletions
diff --git a/app/controllers/config_snom_controller.rb b/app/controllers/config_snom_controller.rb
index f669b8e..da2f8c0 100644
--- a/app/controllers/config_snom_controller.rb
+++ b/app/controllers/config_snom_controller.rb
@@ -1577,12 +1577,8 @@ AAAA'
if sip_account && !sip_account.language_code.blank?
I18n.locale = sip_account.language_code
@locale = sip_account.language_code
- elsif @phone.phoneable
- if @phone.phoneable_type == 'Tenant'
- I18n.locale = tenant.language.code
- elsif @phone.phoneable_type == 'User'
- I18n.locale = @phone.phoneable.language.code
- end
+ elsif @phone.phoneable && @phone.phoneable.respond_to?('language') && @phone.phoneable.language
+ I18n.locale = @phone.phoneable.language.code
end
end
end