Skip to content

Commit

Permalink
[FIX] add postgresql version to travis + avoid sql injection
Browse files Browse the repository at this point in the history
  • Loading branch information
oihane committed Jan 24, 2020
1 parent b69c3d7 commit fc36d95
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
10 changes: 7 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,13 @@ python:
- "2.7"

sudo: false
cache: pip
cache:
apt: true
directories:
- $HOME/.pip-cache/

addons:
postgresql: "9.6"
apt:
packages:
- expect-dev # provides unbuffer utility
Expand All @@ -28,12 +32,12 @@ virtualenv:
system_site_packages: true

install:
- git clone --depth=1 https://github.com/OCA/maintainer-quality-tools.git ${HOME}/maintainer-quality-tools
- git clone --depth=1 https://github.com/avanzosc/maintainer-quality-tools.git ${HOME}/maintainer-quality-tools
- export PATH=${HOME}/maintainer-quality-tools/travis:${PATH}
- travis_install_nightly

script:
- travis_wait travis_run_tests
- travis_run_tests

after_success:
- travis_after_tests_success
Original file line number Diff line number Diff line change
Expand Up @@ -67,5 +67,12 @@ def _group_by(self):

def init(self, cr):
tools.drop_view_if_exists(cr, self._table)
cr.execute("""CREATE or REPLACE VIEW %s as (%s %s %s)
""" % (self._table, self._select(), self._from(), self._group_by()))
cr.execute(
"""CREATE or REPLACE VIEW %(table)s AS
(%(select)s %(from)s %(group_by)s)""",
{
'table': AsIs(self._table)),
'select': AsIs(self._select()),
'from': AsIs(self._from()),
'group_by': AsIs(self._group_by()),
}

0 comments on commit fc36d95

Please sign in to comment.