Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixed #21504 -- Don't shadow database errors when testing for postgis…

… version.

Thanks to trac user paultag for the report.
  • Loading branch information...
commit 17912522cee1277c8c126394fbe94b7172f92e83 1 parent 87ea38c
@bmispelon bmispelon authored
Showing with 2 additions and 2 deletions.
  1. +2 −2 django/contrib/gis/db/backends/postgis/operations.py
View
4 django/contrib/gis/db/backends/postgis/operations.py
@@ -9,7 +9,7 @@
from django.contrib.gis.measure import Distance
from django.core.exceptions import ImproperlyConfigured
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.functional import cached_property
@@ -258,7 +258,7 @@ def spatial_version(self):
else:
try:
vtup = self.postgis_version_tuple()
- except DatabaseError:
+ except ProgrammingError:
raise ImproperlyConfigured(
'Cannot determine PostGIS version for database "%s". '
'GeoDjango requires at least PostGIS version 1.3. '

2 comments on commit 1791252

@paultag

Thanks for this, @bmispelon !

@zyla

Any chances this will be backported to 1.6?

Please sign in to comment.
Something went wrong with that request. Please try again.