From fb6da3d6275d251fa5150b597e459c75c175586b Mon Sep 17 00:00:00 2001 From: Armatik Date: Thu, 25 Apr 2024 15:55:23 +0300 Subject: [PATCH] =?UTF-8?q?=D0=98=D0=B7=D0=BC=D0=B5=D0=BD=D0=B5=D0=BD?= =?UTF-8?q?=D0=B8=D0=B5=20=D0=BD=D0=B0=D0=B8=D0=BC=D0=B5=D0=BD=D0=BE=D0=B2?= =?UTF-8?q?=D0=B0=D0=BD=D0=B8=D1=8F=20db=5Fapi?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/core/main.py | 2 +- src/modules/standard/config/config.py | 3 +++ src/modules/standard/database/__init__.py | 2 +- src/modules/standard/database/tests/test_db.py | 2 +- src/modules/standard/roles/roles.py | 2 +- src/modules/standard/roles/tests/test_roles.py | 4 ++-- 6 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/core/main.py b/src/core/main.py index dad0530..caeb799 100644 --- a/src/core/main.py +++ b/src/core/main.py @@ -1,6 +1,6 @@ from src.modules.standard.config.config import get_config from src.modules.standard.database.models.base import database -from src.modules.standard.database.api import connect_database +from src.modules.standard.database.db_api import connect_database from asyncio import run from aiogram import Bot, Dispatcher diff --git a/src/modules/standard/config/config.py b/src/modules/standard/config/config.py index 49e37da..c58ba57 100644 --- a/src/modules/standard/config/config.py +++ b/src/modules/standard/config/config.py @@ -22,4 +22,7 @@ def get_yandexgpt_catalog_id() -> str: def get_yandexgpt_prompt() -> str: return get_config()["YANDEX_GPT_PROMPT"] +def get_access_rights() -> dict: + return get_config()["ACCESS_RIGHTS"] + diff --git a/src/modules/standard/database/__init__.py b/src/modules/standard/database/__init__.py index dcf9355..f336d57 100644 --- a/src/modules/standard/database/__init__.py +++ b/src/modules/standard/database/__init__.py @@ -1 +1 @@ -from . import api, models \ No newline at end of file +from . import db_api, models \ No newline at end of file diff --git a/src/modules/standard/database/tests/test_db.py b/src/modules/standard/database/tests/test_db.py index a44f86d..e858981 100644 --- a/src/modules/standard/database/tests/test_db.py +++ b/src/modules/standard/database/tests/test_db.py @@ -1,7 +1,7 @@ import unittest import os -from ..api import * +from ..db_api import * from ...exceptions.module_exceptions import MissingModuleName, NotExpectedModuleName diff --git a/src/modules/standard/roles/roles.py b/src/modules/standard/roles/roles.py index 928abfa..0421787 100644 --- a/src/modules/standard/roles/roles.py +++ b/src/modules/standard/roles/roles.py @@ -1,4 +1,4 @@ -from ..database.api import get_user_role +from ..database.db_api import get_user_role from ..config.config import get_config yaml_load = get_config() diff --git a/src/modules/standard/roles/tests/test_roles.py b/src/modules/standard/roles/tests/test_roles.py index 7748e81..2131a3b 100644 --- a/src/modules/standard/roles/tests/test_roles.py +++ b/src/modules/standard/roles/tests/test_roles.py @@ -1,7 +1,7 @@ import os import unittest -from ...database.api import create_tables, connect_database, add_user -from ..api import Roles +from ...database.db_api import create_tables, connect_database, add_user +from ..roles import Roles class TestRoles(unittest.IsolatedAsyncioTestCase):