Skip to content

Commit 5b199be

Browse files
committed
pdf certs now have ID
1 parent 67b3a80 commit 5b199be

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/models/cert.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,13 @@ def cert_code():
1313

1414

1515
async def replace_in_document(
16-
name: str, expires: str, result_filename: str, temp_filename: str
16+
name: str, expires: str, result_filename: str, temp_filename: str, code:str
1717
) -> None:
1818
with open("src/static/certificate.svg", "r", encoding="utf-8") as file:
1919
svg_content = file.read()
2020
svg_content = svg_content.replace("fioHandler", name)
2121
svg_content = svg_content.replace("dateHandler", expires)
22+
svg_content = svg_content.replace("codeHandler", code)
2223

2324
with open(temp_filename, "w", encoding="utf-8") as f:
2425
f.write(svg_content)
@@ -46,7 +47,7 @@ async def generate_file(self):
4647
expire_str = f"{expire.year}/{expire.month}/{expire.day}"
4748

4849
await replace_in_document(
49-
cast(str, self.name), expire_str, path, temp_path
50+
cast(str, self.name), expire_str, path, temp_path, self.code
5051
)
5152
return path
5253

src/static/certificate.svg

Lines changed: 1 addition & 1 deletion
Loading

0 commit comments

Comments
 (0)