Browse Source

Adding a try except to getimagecollections method

Edd Baldry 8 years ago
parent
commit
d2d8a60f18
2 changed files with 5 additions and 4 deletions
  1. 0 1
      .vagrant/machines/default/virtualbox/synced_folders
  2. 5 3
      bakerydemo/base/models.py

+ 0 - 1
.vagrant/machines/default/virtualbox/synced_folders

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

+ 5 - 3
bakerydemo/base/models.py

@@ -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')
     ]