From 5f18cf7c974bff64e8b77db02eae63c8c361f9c0 Mon Sep 17 00:00:00 2001
From: Robin Sonnabend <robin@fsmpi.rwth-aachen.de>
Date: Wed, 6 Jul 2022 10:42:39 +0200
Subject: [PATCH] The Download button should download the main protocol pdf

---
 models/database.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/models/database.py b/models/database.py
index b8e8855..a7c5ebf 100644
--- a/models/database.py
+++ b/models/database.py
@@ -382,7 +382,7 @@ class Protocol(DatabaseModel):
     def has_compiled_document(self, private=None):
         candidates = [
             document for document in self.documents
-            if document.is_compiled
+            if document.is_compiled and not document.is_extra
             and (private is None or document.is_private == private)
         ]
         return len(candidates) > 0
@@ -390,7 +390,7 @@ class Protocol(DatabaseModel):
     def get_compiled_document(self, private=None):
         candidates = [
             document for document in self.documents
-            if document.is_compiled
+            if document.is_compiled and not document.is_extra
         ]
         private_candidates = [
             document for document in candidates
-- 
GitLab