Adding a try except to getimagecollections method

pull/2/head
Edd Baldry 2017-02-09 16:04:16 +00:00
rodzic 479c993b85
commit d2d8a60f18
2 zmienionych plików z 5 dodań i 4 usunięć

Wyświetl plik

@ -1 +0,0 @@
{"virtualbox":{"/vagrant":{"guestpath":"/vagrant","hostpath":"/Users/edd/Documents/sites/bakerydemo","disabled":false,"__vagrantfile":true}}}

Wyświetl plik

@ -122,8 +122,10 @@ class GalleryPage(Page):
"""
This is a page to list all the locations on the site
"""
CHOICES_LIST = getImageCollections()
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
@ -145,7 +147,7 @@ class GalleryPage(Page):
blank=True)
content_panels = Page.content_panels + [
# FieldPanel('choices'),
FieldPanel('choices'),
ImageChooserPanel('image'),
FieldPanel('introduction')
]