-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add corpus info to config * Push new lockfile to fix dependency error * Test corpora in config keys * Readd tests for checking corpora and taxonomy * Bump to 2.6.0 * Fix tests
- Loading branch information
1 parent
6507a49
commit 7959e55
Showing
11 changed files
with
317 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,33 @@ | ||
import logging | ||
|
||
from pydantic import ConfigDict, validate_call | ||
from sqlalchemy import exc | ||
|
||
import app.clients.db.session as db_session | ||
import app.repository.config as config_repo | ||
from app.errors import RepositoryError | ||
from app.model.config import ConfigReadDTO | ||
from app.service import app_user | ||
|
||
_LOGGER = logging.getLogger(__name__) | ||
|
||
|
||
def get() -> ConfigReadDTO: | ||
@validate_call(config=ConfigDict(arbitrary_types_allowed=True)) | ||
def get(user_email: str) -> ConfigReadDTO: | ||
""" | ||
Gets the config | ||
:raises RepositoryError: If there is an issue getting the config | ||
:return ConfigReadDTO: The config for the application | ||
""" | ||
|
||
try: | ||
with db_session.get_db() as db: | ||
return config_repo.get(db) | ||
# Get the organisation from the user's email | ||
org_id = app_user.get_organisation(db, user_email) | ||
|
||
return config_repo.get(db, org_id) | ||
|
||
except exc.SQLAlchemyError: | ||
_LOGGER.exception("Error while getting config") | ||
raise RepositoryError("Could not get the config") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[tool.poetry] | ||
name = "admin_backend" | ||
version = "2.5.1" | ||
version = "2.6.0" | ||
description = "" | ||
authors = ["CPR-dev-team <[email protected]>"] | ||
packages = [{ include = "app" }, { include = "tests" }] | ||
|
Oops, something went wrong.