From ce59f4b78b73e5b01cf18d8a0379b03279d61565 Mon Sep 17 00:00:00 2001
From: pabois <pierreandre.boissinot@noesya.coop>
Date: Thu, 8 Dec 2022 15:29:44 +0100
Subject: [PATCH] enforce should_show_years

---
 app/models/communication/extranet.rb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/app/models/communication/extranet.rb b/app/models/communication/extranet.rb
index f4ea7452a..8255e487b 100644
--- a/app/models/communication/extranet.rb
+++ b/app/models/communication/extranet.rb
@@ -59,7 +59,7 @@ class Communication::Extranet < ApplicationRecord
 
   def should_show_years?
     # For a single program, year is like cohort
-    return false if about&.is_a? Education::Program
+    return false if about.nil? || about&.is_a? Education::Program
     # if a school has a single program, same thing
     about&.programs&.many?
   end
-- 
GitLab