From e8942eaa075c1c4bca27b818e70d8621cfa9ae21 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=C3=A9bastien=20Gaya?= <sebastien.gaya@gmail.com>
Date: Fri, 17 Dec 2021 10:39:41 +0100
Subject: [PATCH] valid for publication

---
 app/models/communication/website/github_file.rb | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/app/models/communication/website/github_file.rb b/app/models/communication/website/github_file.rb
index 00745fe4b..e596d5839 100644
--- a/app/models/communication/website/github_file.rb
+++ b/app/models/communication/website/github_file.rb
@@ -123,7 +123,11 @@ class Communication::Website::GithubFile < ApplicationRecord
   end
 
   def valid_for_publication?
-    return about.published? if about_type == 'Communication::Website::Post'
-    true
+    case about_type
+    when 'Communication::Website::Page', 'Communication::Website::Post'
+      about.published?
+    else
+      true
+    end
   end
 end
-- 
GitLab