From c4af6be3ae04c296e7a6959a73ca1d53b207b182 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=C3=A9bastien=20Gaya?= <sebastien.gaya@gmail.com>
Date: Wed, 5 Jun 2024 16:49:02 +0200
Subject: [PATCH] handle non-osuny websites (#1983)

---
 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 @@ module Communication::Website::WithTheme
   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
-- 
GitLab