Revize f3125948
Přidáno uživatelem Stanislav Král před asi 4 roky(ů)
src/dao/certificate_repository.py | ||
---|---|---|
50 | 50 |
|
51 | 51 |
last_id: int = self.cursor.lastrowid |
52 | 52 |
|
53 |
if certificate.usages[ROOT_CA_ID - 1]: |
|
53 |
# TODO assure that this is correct |
|
54 |
if certificate.type_id == ROOT_CA_ID: |
|
54 | 55 |
certificate.parent_id = last_id |
55 | 56 |
return self.update(last_id, certificate) |
56 | 57 |
else: |
... | ... | |
202 | 203 |
self.cursor.execute(sql, values) |
203 | 204 |
self.connection.commit() |
204 | 205 |
|
205 |
for usage_id, usage_value in certificate.usages: |
|
206 |
# iterate over usage pairs |
|
207 |
for usage_id, usage_value in certificate.usages.items(): |
|
206 | 208 |
if usage_value: |
207 | 209 |
sql = (f"INSERT INTO {TAB_CERTIFICATE_USAGES} " |
208 | 210 |
f"({COL_CERTIFICATE_ID}," |
Také k dispozici: Unified diff
Re #8472 - Made small fixes to the CertificateRepository