mirror of https://github.com/django/django.git
Fixed #21504 -- Don't shadow database errors when testing for postgis version.
Thanks to trac user paultag for the report.
This commit is contained in:
parent
87ea38cc9e
commit
17912522ce
|
@ -9,7 +9,7 @@ from django.contrib.gis.geometry.backend import Geometry
|
||||||
from django.contrib.gis.measure import Distance
|
from django.contrib.gis.measure import Distance
|
||||||
from django.core.exceptions import ImproperlyConfigured
|
from django.core.exceptions import ImproperlyConfigured
|
||||||
from django.db.backends.postgresql_psycopg2.base import DatabaseOperations
|
from django.db.backends.postgresql_psycopg2.base import DatabaseOperations
|
||||||
from django.db.utils import DatabaseError
|
from django.db.utils import ProgrammingError
|
||||||
from django.utils import six
|
from django.utils import six
|
||||||
from django.utils.functional import cached_property
|
from django.utils.functional import cached_property
|
||||||
|
|
||||||
|
@ -258,7 +258,7 @@ class PostGISOperations(DatabaseOperations, BaseSpatialOperations):
|
||||||
else:
|
else:
|
||||||
try:
|
try:
|
||||||
vtup = self.postgis_version_tuple()
|
vtup = self.postgis_version_tuple()
|
||||||
except DatabaseError:
|
except ProgrammingError:
|
||||||
raise ImproperlyConfigured(
|
raise ImproperlyConfigured(
|
||||||
'Cannot determine PostGIS version for database "%s". '
|
'Cannot determine PostGIS version for database "%s". '
|
||||||
'GeoDjango requires at least PostGIS version 1.3. '
|
'GeoDjango requires at least PostGIS version 1.3. '
|
||||||
|
|
Loading…
Reference in New Issue