diff --git a/models/database.py b/models/database.py
index b8e8855385abcbb51528a7f7db7c7c5786d99c21..a7c5ebf7e249c382ad01ed00555d25d896d7e893 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