Skip to content

Commit 90ccf83

Browse files
committed
Fix: Old pastes don't have annotations
1 parent 60d163b commit 90ccf83

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

core/models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ def __init__(self, record: asyncpg.Record | dict[str, Any]) -> None:
6666
self.loc: int = record["loc"]
6767
self.charcount: int = record["charcount"]
6868
self.index: int = record["file_index"]
69-
self.annotation: str = record["annotation"]
69+
self.annotation: str | None = record["annotation"]
7070
self.warning_positions: list[int] = record["warning_positions"]
7171

7272

views/htmx.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ def highlight_code(self, *, files: list[dict[str, Any]]) -> str:
5454
filename = "_".join(filename.splitlines())
5555

5656
raw_url: str = f'/raw/{file["parent_id"]}'
57-
annotation: str = file["annotation"]
57+
annotation: str = file["annotation"] or ""
5858
positions: list[int] = file.get("warning_positions", [])
5959
original: str = file["content"]
6060

0 commit comments

Comments
 (0)