Browse Source

[FIX] doesn't try to replace params if they are no args

pull/1330/head
Sylvain LE GAL 6 years ago
parent
commit
4c86e073d4
  1. 4
      sql_request_abstract/models/sql_request_mixin.py

4
sql_request_abstract/models/sql_request_mixin.py

@ -144,9 +144,11 @@ class SQLRequestMixin(models.AbstractModel):
if mode in ('view', 'materialized_view'): if mode in ('view', 'materialized_view'):
rollback = False rollback = False
params = params or {}
# pylint: disable=sql-injection # pylint: disable=sql-injection
if params:
query = self.query % params query = self.query % params
else:
query = self.query
query = query.decode('utf-8') query = query.decode('utf-8')
if mode in ('fetchone', 'fetchall'): if mode in ('fetchone', 'fetchall'):

Loading…
Cancel
Save