Skip to content

Commit

Permalink
Fix: Old pastes don't have annotations
Browse files Browse the repository at this point in the history
  • Loading branch information
EvieePy committed May 29, 2024
1 parent 60d163b commit 90ccf83
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion core/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def __init__(self, record: asyncpg.Record | dict[str, Any]) -> None:
self.loc: int = record["loc"]
self.charcount: int = record["charcount"]
self.index: int = record["file_index"]
self.annotation: str = record["annotation"]
self.annotation: str | None = record["annotation"]
self.warning_positions: list[int] = record["warning_positions"]


Expand Down
2 changes: 1 addition & 1 deletion views/htmx.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def highlight_code(self, *, files: list[dict[str, Any]]) -> str:
filename = "_".join(filename.splitlines())

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

Expand Down

0 comments on commit 90ccf83

Please sign in to comment.