fix pylint C0206 (consider-using-dict-items)
This commit is contained in:
parent
3e42adc66f
commit
967ce06ca5
2 changed files with 9 additions and 7 deletions
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -50,11 +50,13 @@ 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]:
|
||||
raise Exception(
|
||||
f"sqlite database version ({dblite[key]}) of {key} doesn't match postgres database version {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 ({value}) of {key} doesn't match postgres database version {version}"
|
||||
)
|
||||
|
||||
connection = postgres.connection
|
||||
postgres.close()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue