fix pylint C0206 (consider-using-dict-items)

This commit is contained in:
Pavol Rusnak 2023-01-21 12:15:18 +00:00
parent 3e42adc66f
commit 967ce06ca5
No known key found for this signature in database
GPG key ID: 91F3B339B9A02A3D
2 changed files with 9 additions and 7 deletions

View file

@ -83,8 +83,8 @@ def url_for_vendored(abspath: str) -> str:
def url_for(endpoint: str, external: Optional[bool] = False, **params: Any) -> str:
base = g().base_url if external else ""
url_params = "?"
for key in params:
url_params += f"{key}={params[key]}&"
for key, value in params.items():
url_params += f"{key}={value}&"
url = f"{base}{endpoint}{url_params}"
return url

View file

@ -50,10 +50,12 @@ def check_db_versions(sqdb):
postgres.execute("SELECT * FROM public.dbversions;")
dbpost = dict(postgres.fetchall())
for key in dblite.keys():
if key in dblite and key in dbpost and dblite[key] != dbpost[key]:
for key, value in dblite.items():
if key in dblite and key in dbpost:
version = dbpost[key]
if value != version:
raise Exception(
f"sqlite database version ({dblite[key]}) of {key} doesn't match postgres database version {dbpost[key]}"
f"sqlite database version ({value}) of {key} doesn't match postgres database version {version}"
)
connection = postgres.connection