src/pyams_content/component/paragraph/interfaces/contact.py
changeset 495 512c874493b9
parent 429 fafbf6bb246e
child 515 a1d5eb955e54
--- a/src/pyams_content/component/paragraph/interfaces/contact.py	Thu Mar 22 15:03:30 2018 +0100
+++ b/src/pyams_content/component/paragraph/interfaces/contact.py	Thu Mar 22 19:12:33 2018 +0100
@@ -20,7 +20,12 @@
 
 # import packages
 from pyams_file.schema import ImageField
-from pyams_gis.schema import GeoPointField
+try:
+    from pyams_gis.schema import GeoPointField
+except ImportError:
+    have_gis = False
+else:
+    have_gis = True
 from pyams_i18n.schema import I18nTextLineField
 from zope.schema import TextLine, Text, Choice
 
@@ -50,9 +55,10 @@
                        description=_("Use 'browse' button to select contact picture"),
                        required=False)
 
-    gps_location = GeoPointField(title=_("GPS location"),
-                                 description=_("GPS coordinates used to locate contact"),
-                                 required=False)
+    if have_gis:
+        gps_location = GeoPointField(title=_("GPS location"),
+                                     description=_("GPS coordinates used to locate contact"),
+                                     required=False)
 
     address = Text(title=_("Address"),
                    required=False)