Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#22334 closed Bug (worksforme)

Postgis version check discards dev versions

Reported by: xowap Owned by: nobody
Component: GIS Version: 1.6
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: yes Patch needs improvement: yes
Easy pickings: no UI/UX: no


After installing a dev version of Postgis, I noticed that my Django app started to throw django.core.exceptions.ImproperlyConfigured: Cannot determine PostGIS version for database "gmp". GeoDjango requires at least PostGIS version 1.3. Was the database created from a spatial database template?

Actually the version check regular expression did only accept regular version numbers (like 2.1.0) but not development version numbers (2.2.0dev).

Change History (8)

comment:2 Changed 4 years ago by Sasha Romijn

Component: UncategorizedGIS
Needs tests: set
Patch needs improvement: set
Triage Stage: UnreviewedAccepted

This seems sensible to me, the only thing that is missing is a test for the newly supported behaviour. Could you add that to your PR?

comment:3 Changed 4 years ago by xowap

Sure I will do.

I looked into it, however I could not find a proper place to put them. Would you have a recommendation to make on this subject?

comment:4 Changed 4 years ago by Claude Paroz

Indeed. Feel free to create a new django/contrib/gis/tests/ file.

comment:5 Changed 4 years ago by anonymous

Hum, this is embarrassing: while writing the tests, I discovered that I could not reproduce the bug on the unpatched code. Indeed, there is no $ at the end of the regexp.

I have no idea of how writing this patch turned the DB connection from "not working" to "working", but it wasn't probably correlated that much.

However, I wrote and pushed some unit tests, in case you want to keep them anyway.

comment:6 Changed 4 years ago by Claude Paroz <claude@…>

In 88f1e3d93d8f48a302ff75b1936e471c4a52fff9:

Unit testing Postgis version check

Refs #22334.

comment:7 Changed 4 years ago by Claude Paroz

Resolution: worksforme
Status: newclosed

Thanks for the tests!

comment:8 Changed 4 years ago by Claude Paroz <claude@…>

In e819a3cd622fe9404b1f5ea7891906c4cdabbb12:

Skipped PostGIS version tests when psycopg2 not installed

Refs #22334. Thanks Tim Graham for spotting the issue.

Note: See TracTickets for help on using tickets.
Back to Top