Choices block in gallery

pull/2/head
Arnar Tumi Þorsteinsson 2017-02-09 16:20:51 +00:00
rodzic d2d8a60f18
commit 9d32c1437c
1 zmienionych plików z 13 dodań i 9 usunięć

Wyświetl plik

@ -111,21 +111,25 @@ class AboutPage(Page):
def getImageCollections():
# We return all collections to a list that don't have the name root.
return [(
collection.id, collection.name
) for collection in Collection.objects.all().exclude(
name='Root'
)]
try:
collection_images = [(
collection.id, collection.name
) for collection in Collection.objects.all().exclude(
name='Root'
)]
return collection_images
except:
return [('','')]
class GalleryPage(Page):
"""
This is a page to list all the locations on the site
"""
try:
CHOICES_LIST = getImageCollections()
except:
CHOICES_LIST = [("", "")]
# try:
CHOICES_LIST = getImageCollections()
# except:
# CHOICES_LIST = [("", "")]
# To return our collection choices for the editor to access we need to
# make the choices list a variable rather than a function