Fix remote PEP8 errors as well

This commit is contained in:
Noémi Ványi 2021-04-29 22:05:31 +02:00
parent aa8288a963
commit dee75accf6
2 changed files with 10 additions and 2 deletions

View File

@ -3,6 +3,10 @@
MySQL database (Offline)
"""
# error is ignored because the admin has to
# install it manually to use the engine
# pylint: disable=import-error
import mysql.connector
@ -49,7 +53,7 @@ def search(query, params):
def _fetch_results(cur):
results = []
for res in cur:
result = dict(zip(cur.column_names, map(str, res))),
result = dict(zip(cur.column_names, map(str, res)))
result['template'] = result_template
results.append(result)

View File

@ -3,6 +3,10 @@
PostgreSQL database (Offline)
"""
# error is ignored because the admin has to
# install it manually to use the engine
# pylint: disable=import-error
import psycopg2
engine_type = 'offline'
@ -41,7 +45,7 @@ def search(query, params):
with _connection:
with _connection.cursor() as cur:
cur.execute(query_str, query_params)
cur.execute(query_to_run, query_params)
return _fetch_results(cur)