Skip to content

Commit

Permalink
flake8 checks
Browse files Browse the repository at this point in the history
  • Loading branch information
cezio committed Oct 11, 2017
1 parent 050e6fc commit dc65d11
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions geonode/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@
ALPHABET_REVERSE = dict((c, i) for (i, c) in enumerate(ALPHABET))
BASE = len(ALPHABET)
SIGN_CHARACTER = '$'
SQL_PARAMS_RE = re.compile(r'%\(([\w_\-]+)\)s')

http_client = httplib2.Http()

Expand Down Expand Up @@ -994,13 +995,11 @@ def parse_datetime(value):
raise ValueError("Invalid datetime input: {}".format(value))


sql_params_re = re.compile(r'%\(([\w_\-]+)\)s')

def _convert_sql_params(cur, query):
# sqlite driver doesn't support %(key)s notation,
# use :key instead.
if cur.db.vendor in ('sqlite', 'sqlite3', 'spatialite',):
return sql_params_re.sub(r':\1', query)
return SQL_PARAMS_RE.sub(r':\1', query)
return query


Expand Down

0 comments on commit dc65d11

Please sign in to comment.