From 8206aba69a4df4a0cd2732df0719e7ed4daa00a8 Mon Sep 17 00:00:00 2001
From: pabois <pierreandre.boissinot@noesya.coop>
Date: Thu, 16 Feb 2023 16:31:27 +0100
Subject: [PATCH] fix bloc language when about has no language

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

diff --git a/app/models/communication/block.rb b/app/models/communication/block.rb
index 9c1a12b62..1369e18f4 100644
--- a/app/models/communication/block.rb
+++ b/app/models/communication/block.rb
@@ -99,7 +99,7 @@ class Communication::Block < ApplicationRecord
 
   def language
     return @language if defined?(@language)
-    @language ||= about.respond_to?(:language) ? about.language : nil
+    @language ||= about.respond_to?(:language) ? about.language : about.university.default_language
   end
 
   def duplicate
-- 
GitLab