fix colleciton links

This commit is contained in:
j 2023-07-20 12:33:12 +01:00
parent b13b621fd0
commit 6e283ad870

View file

@ -518,6 +518,7 @@ actions.register(autocompleteDocuments)
def document(request, fragment):
context = {}
parts = fragment.split('/')
# FIXME: parse collection urls and return the right metadata for those
id = parts[0]
page = None
crop = None
@ -527,7 +528,10 @@ def document(request, fragment):
page = rect[0]
else:
crop = rect
try:
document = models.Document.objects.filter(id=ox.fromAZ(id)).first()
except:
document = None
if document and document.access(request.user):
context['title'] = document.data['title']
if document.data.get('description'):