Skip to content

Commit 54a4f1e

Browse files
committed
handle no GDAL installed with geopoint faker
1 parent 20f52fb commit 54a4f1e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

ckc/providers.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Doing a try/except here so we don't force end users of the
22
# django-ckc module to install factory boy.
3+
from django.core.exceptions import ImproperlyConfigured
4+
35
try:
46
import factory
57
from django.contrib.gis.geos import Point
@@ -22,5 +24,5 @@ def geo_point(self, **kwargs):
2224
# ('40.72371', '-73.95097', 'Greenpoint', 'US', 'America/New_York')
2325
coords = faker.local_latlng(**kwargs)
2426
return Point(x=float(coords[1]), y=float(coords[0]), srid=4326)
25-
except ImportError:
27+
except (ImportError, ImproperlyConfigured):
2628
pass

0 commit comments

Comments
 (0)