Skip to content

Commit 050cdb9

Browse files
committed
create /db consistently from the backend
1 parent ee19072 commit 050cdb9

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

backend/ciso_assistant/settings.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,20 @@ def set_ciso_assistant_url(_, __, event_dict):
105105
logger.info("BUILD: %s", BUILD)
106106
logger.info("SCHEMA_VERSION: %s", SCHEMA_VERSION)
107107

108+
# Ensure required directories exist
109+
110+
db_dir = BASE_DIR / "db"
111+
attachments_dir = db_dir / "attachments"
112+
113+
# Create directories if they don't exist
114+
if not db_dir.exists():
115+
db_dir.mkdir(parents=True, exist_ok=True)
116+
logger.info("Created directory: %s", db_dir)
117+
118+
if not attachments_dir.exists():
119+
attachments_dir.mkdir(parents=True, exist_ok=True)
120+
logger.info("Created directory: %s", attachments_dir)
121+
108122
# TODO: multiple paths are explicit, it should use path join to be more generic
109123

110124
# Quick-start development settings - unsuitable for production

0 commit comments

Comments
 (0)