Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
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: http://code.djangoproject.com/svn/django/trunk@12354 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 901b60e7e195d23b0f66caa3ecab1299a2e15235 1 parent 199cd0e
@jbronn jbronn authored
Showing with 3 additions and 2 deletions.
  1. +3 −2 django/contrib/gis/db/backends/postgis/operations.py
View
5 django/contrib/gis/db/backends/postgis/operations.py
@@ -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 '
Please sign in to comment.
Something went wrong with that request. Please try again.