Browse files

Now look for `DatabaseError` during PostGIS backend initialization, a…

…s it is now raised instead of a `ProgrammingError` after changes in r12352.

git-svn-id: bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
1 parent 199cd0e commit 901b60e7e195d23b0f66caa3ecab1299a2e15235 @jbronn jbronn committed Jan 29, 2010
Showing with 3 additions and 2 deletions.
  1. +3 −2 django/contrib/gis/db/backends/postgis/
@@ -8,7 +8,8 @@
from django.contrib.gis.geometry.backend import Geometry
from django.contrib.gis.measure import Distance
from django.core.exceptions import ImproperlyConfigured
-from django.db.backends.postgresql_psycopg2.base import Database, DatabaseOperations
+from django.db.backends.postgresql_psycopg2.base import DatabaseOperations
+from django.db.utils import DatabaseError
#### Classes used in constructing PostGIS spatial SQL ####
class PostGISOperator(SpatialOperation):
@@ -99,7 +100,7 @@ def __init__(self, connection):
self.geom_func_prefix = prefix
self.spatial_version = version
- except Database.ProgrammingError:
+ except DatabaseError:
raise ImproperlyConfigured('Cannot determine PostGIS version for database "%s". '
'GeoDjango requires at least PostGIS version 1.3. '
'Was the database created from a spatial database '

0 comments on commit 901b60e

Please sign in to comment.