Skip to content

Commit

Permalink
Fix the Jinja loader
Browse files Browse the repository at this point in the history
  • Loading branch information
sbrunner committed Jun 29, 2023
1 parent e6c434e commit 863eb06
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions scan_to_paperless/status.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import os.path
from typing import Dict, NamedTuple, Optional

from jinja2 import Environment, PackageLoader, select_autoescape
import jinja2
from ruamel.yaml.main import YAML

WAITING_STATUS_NAME = "Waiting validation"
Expand Down Expand Up @@ -170,7 +170,10 @@ def write(self) -> None:
return

with open(self._file, "w", encoding="utf-8") as status_file:
env = Environment(loader=PackageLoader("scan_to_paperless"), autoescape=select_autoescape())
env = jinja2.Environment(
loader=jinja2.FileSystemLoader(os.path.dirname(__file__)),
autoescape=jinja2.select_autoescape(),
)
template = env.get_template("status.html")
status_file.write(
template.render(
Expand Down

0 comments on commit 863eb06

Please # to comment.