From fee30c58440a736120869958f8bd3372d3f0bf0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Gaya?= Date: Wed, 5 Jun 2024 10:58:38 +0200 Subject: [PATCH] handle non-osuny websites --- app/models/communication/website/with_theme.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/models/communication/website/with_theme.rb b/app/models/communication/website/with_theme.rb index c37484827..b63afbc6f 100644 --- a/app/models/communication/website/with_theme.rb +++ b/app/models/communication/website/with_theme.rb @@ -1,6 +1,6 @@ module Communication::Website::WithTheme extend ActiveSupport::Concern - + included do scope :with_automatic_update, -> { where(autoupdate_theme: true) } scope :with_manual_update, -> { where(autoupdate_theme: false) } @@ -33,7 +33,8 @@ def theme_updatable? protected def current_theme_version - URI(theme_version_url).read + response = Faraday.get(theme_version_url) + response.status == 200 ? response.body : 'NA' rescue 'NA' end