Skip to content

Commit

Permalink
Fix future DeprecationWarning in db.py
Browse files Browse the repository at this point in the history
Python 3.12 throws deprecation warnings for mismatch between positional
and named parameters in sqlite calls. So let's not do that.
  • Loading branch information
magnuswatn committed Nov 12, 2023
1 parent c341840 commit a890301
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions api/sertifikatsok/db.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,11 @@ def connect_to_database(cls, database_file: str = DATABASE_FILE) -> Database:
:environment)
""",
[
(ldap_server.hostname, ldap_server.ca.value, environment.value)
{
"ldap_server": ldap_server.hostname,
"ca": ldap_server.ca.value,
"environment": environment.value,
}
for environment, ldap_servers in LDAP_SERVERS.items()
for ldap_server in ldap_servers
],
Expand All @@ -146,7 +150,7 @@ def insert_certificates(
"""
SELECT id
FROM ldap_server
WHERE ldap_server = :ldap_server
WHERE ldap_server = ?
""",
(ldap_server,),
).fetchone()
Expand Down

0 comments on commit a890301

Please sign in to comment.