Skip to content

Commit

Permalink
[#560] Correct version comparison
Browse files Browse the repository at this point in the history
  • Loading branch information
domoritz committed Mar 6, 2013
1 parent 9dd37f0 commit 690655b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions ckanext/datastore/db.py
Expand Up @@ -58,7 +58,7 @@ def _pluck(field, arr):

def _get_list(input, strip=True):
"""Transforms a string or list to a list"""
if input == None:
if input is None:
return
if input == '':
return []
Expand Down Expand Up @@ -142,11 +142,11 @@ def _cache_types(context):

def _pg_version_is_at_least(connection, version):
try:
v = distutils.version.LooseVersion(version)
pg_version = connection.execute('select version();').fetchone()
pg_version_number = pg_version[0].split()[1]
v = distutils.version.LooseVersion(version)
pv = distutils.version.LooseVersion(pg_version_number)
return v >= pv
return v <= pv
except ValueError:
return False

Expand Down

0 comments on commit 690655b

Please sign in to comment.