Skip to content

Commit 4995f91

Browse files
committed
Fix data loading in Content Manager by using absolute path resolution
1 parent e0ed86d commit 4995f91

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

modules/contentManager/data_io.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,11 @@
33
import shutil
44
from datetime import datetime
55

6-
DATA_DIR = "Mythril.Blazor/wwwroot/data"
6+
# Resolve DATA_DIR relative to this file's location (modules/contentManager/data_io.py)
7+
# Root is two levels up from this file
8+
SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
9+
PROJECT_ROOT = os.path.abspath(os.path.join(SCRIPT_DIR, "..", ".."))
10+
DATA_DIR = os.path.join(PROJECT_ROOT, "Mythril.Blazor", "wwwroot", "data")
711

812
class ContentManager:
913
def __init__(self, data_dir=DATA_DIR):

0 commit comments

Comments
 (0)