Skip to content

Commit

Permalink
UI settings might not be available.
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas Massmann committed Mar 8, 2015
1 parent 3dcc5b4 commit cc9779a
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/ps/plone/mls/browser/developments/details.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@
from Products.Five import BrowserView
from plone import api as plone_api
from plone.directives import form
from plone.mls.listing.interfaces import IMLSUISettings
try:
from plone.mls.listing.interfaces import IMLSUISettings
HAS_UI_SETTINGS = True
except ImportError:
HAS_UI_SETTINGS = False
from plone.registry.interfaces import IRegistry
from plone.z3cform import z2
from z3c.form import (
Expand Down Expand Up @@ -299,6 +303,9 @@ def javascript_map(self):
)

def use_fotorama(self):
if not HAS_UI_SETTINGS:
return False

if self.registry is not None:
try:
settings = self.registry.forInterface(IMLSUISettings)
Expand All @@ -309,6 +316,9 @@ def use_fotorama(self):
return False

def use_galleria(self):
if not HAS_UI_SETTINGS:
return True

if self.registry is not None:
try:
settings = self.registry.forInterface(IMLSUISettings)
Expand Down

0 comments on commit cc9779a

Please sign in to comment.