From 1e3687868862c15594ba1e7a7b86fa5ac9bab3a3 Mon Sep 17 00:00:00 2001 From: Luc Didry Date: Thu, 25 Apr 2024 13:35:10 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=A9=B9=20=E2=80=94=20Fix=20a=20relative?= =?UTF-8?q?=20path=20bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- argos/server/routes/views.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/argos/server/routes/views.py b/argos/server/routes/views.py index fd5fc32..4029c0e 100644 --- a/argos/server/routes/views.py +++ b/argos/server/routes/views.py @@ -1,6 +1,7 @@ """Web interface for humans""" from collections import defaultdict from functools import cmp_to_key +from os import path from typing import Annotated from urllib.parse import urlparse @@ -17,7 +18,8 @@ from argos.server.routes.dependencies import get_config, get_db route = APIRouter() -templates = Jinja2Templates(directory="argos/server/templates") +current_dir = path.dirname(__file__) +templates = Jinja2Templates(directory=path.join(current_dir, "../templates")) SEVERITY_LEVELS = {"ok": 1, "warning": 2, "critical": 3, "unknown": 4}