fix colleciton links
This commit is contained in:
parent
b13b621fd0
commit
6e283ad870
1 changed files with 5 additions and 1 deletions
|
@ -518,6 +518,7 @@ actions.register(autocompleteDocuments)
|
||||||
def document(request, fragment):
|
def document(request, fragment):
|
||||||
context = {}
|
context = {}
|
||||||
parts = fragment.split('/')
|
parts = fragment.split('/')
|
||||||
|
# FIXME: parse collection urls and return the right metadata for those
|
||||||
id = parts[0]
|
id = parts[0]
|
||||||
page = None
|
page = None
|
||||||
crop = None
|
crop = None
|
||||||
|
@ -527,7 +528,10 @@ def document(request, fragment):
|
||||||
page = rect[0]
|
page = rect[0]
|
||||||
else:
|
else:
|
||||||
crop = rect
|
crop = rect
|
||||||
document = models.Document.objects.filter(id=ox.fromAZ(id)).first()
|
try:
|
||||||
|
document = models.Document.objects.filter(id=ox.fromAZ(id)).first()
|
||||||
|
except:
|
||||||
|
document = None
|
||||||
if document and document.access(request.user):
|
if document and document.access(request.user):
|
||||||
context['title'] = document.data['title']
|
context['title'] = document.data['title']
|
||||||
if document.data.get('description'):
|
if document.data.get('description'):
|
||||||
|
|
Loading…
Reference in a new issue