Ignore document stub from the index mirror. GitLab issue #520. Thanks to TheOneValen @TheOneValen for the report.

Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
This commit is contained in:
Roberto Rosario
2018-10-13 03:41:46 -04:00
parent 88f41a570e
commit 8c6ba747f0
4 changed files with 35 additions and 3 deletions

View File

@@ -80,7 +80,9 @@ class IndexFilesystem(Operations):
if access_only:
return True
else:
return Document.objects.get(pk=document_pk)
return Document.objects.get(
is_stub=False, pk=document_pk
)
for count, part in enumerate(parts[1:]):
try:
@@ -93,7 +95,9 @@ class IndexFilesystem(Operations):
else:
try:
if node.index_template_node.link_documents:
document = node.documents.get(label=part)
document = node.documents.get(
is_stub=False, label=part
)
logger.debug(
'path %s is a valid file path', path
)
@@ -203,7 +207,7 @@ class IndexFilesystem(Operations):
# Documents
if node.index_template_node.link_documents:
queryset = node.documents.values('label').exclude(
queryset = node.documents.filter(is_stub=False).values('label').exclude(
label__contains='/'
)