diff --git a/app/controllers/concerns/foreman/controller/timezone.rb b/app/controllers/concerns/foreman/controller/timezone.rb index 5f8e09d1608..962186e86c1 100644 --- a/app/controllers/concerns/foreman/controller/timezone.rb +++ b/app/controllers/concerns/foreman/controller/timezone.rb @@ -8,6 +8,9 @@ def set_timezone client_timezone = User.current.try(:timezone) || cookies[:timezone] Time.zone = client_timezone if client_timezone.present? yield + rescue ArgumentError + Time.zone = ActiveSupport::TimeZone['UTC'] + yield ensure # Reset timezone for the next thread Time.zone = default_timezone