Skip to content

Commit

Permalink
fix (config.py): to correct files path processing
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrey-Ved committed Dec 17, 2023
1 parent dfd4b8f commit ea246f4
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions app/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from cryptography.fernet import Fernet # noqa
from dynaconf import Dynaconf
from os import path as os_path
from os.path import dirname, sep, abspath
from pathlib import Path


Expand All @@ -12,15 +12,18 @@


def add_path(
path: str | Path,
additional_path: str | Path,
file_name: str | Path
) -> str:
root_path = os_path.dirname(
os_path.dirname(
os_path.abspath(__file__)
root_path = dirname(
dirname(
abspath(__file__)
)
)
return root_path + os_path.sep + path + os_path.sep + file_name
if additional_path:
return root_path + sep + additional_path + sep + file_name

return root_path + sep + file_name


def settings_init(
Expand Down

0 comments on commit ea246f4

Please sign in to comment.