Skip to content

Commit

Permalink
🐛 Fix load existence check not looking in the given location
Browse files Browse the repository at this point in the history
  • Loading branch information
davep committed Jan 27, 2025
1 parent f9c7191 commit ff6d264
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/peplum/app/data/notes.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,10 @@ def load(self, source: Path | None = None) -> Self:
Returns:
Self.
"""
if self._NOTES_FILE.exists():
if (source := source or self._NOTES_FILE).exists():
self._notes = {
int(number): note
for number, note in loads(
(source or self._NOTES_FILE).read_text(encoding="utf-8")
).items()
for number, note in loads(source.read_text(encoding="utf-8")).items()
}
return self

Expand Down

0 comments on commit ff6d264

Please sign in to comment.