mirror of
https://github.com/django/django.git
synced 2024-12-01 15:42:04 +01:00
Now look for DatabaseError
during PostGIS backend initialization, as 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
This commit is contained in:
parent
199cd0efca
commit
901b60e7e1
@ -8,7 +8,8 @@ from django.contrib.gis.db.backends.postgis.adapter import PostGISAdapter
|
||||
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 @@ class PostGISOperations(DatabaseOperations, BaseSpatialOperations):
|
||||
|
||||
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 '
|
||||
|
Loading…
Reference in New Issue
Block a user