Skip to content

Commit

Permalink
Rename Taxhub configuration parameters : TAXHUB_CONF
Browse files Browse the repository at this point in the history
  • Loading branch information
amandine-sahl committed Aug 8, 2024
1 parent ae81ade commit d42392b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion backend/geonature/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ def set_sentry_context():
# taxhub api
from apptax import taxhub_api_routes

base_api_prefix = app.config["TAXHUB_API"].get("API_PREFIX")
base_api_prefix = app.config["TAXHUB_CONF"].get("API_PREFIX")

for blueprint_path, url_prefix in taxhub_api_routes:
module_name, blueprint_name = blueprint_path.split(":")
Expand Down
6 changes: 4 additions & 2 deletions backend/geonature/utils/config_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
from geonature.utils.module import iter_modules_dist, get_module_config
from geonature.utils.utilsmails import clean_recipients
from pypnusershub.auth.authentication import ProviderConfigurationSchema
from apptax.utils.config.config_schema import TaxhubApiConf
from apptax.utils.config.config_schema import TaxhubAppConf


class EmailStrOrListOfEmailStrField(fields.Field):
Expand Down Expand Up @@ -206,7 +206,9 @@ class GnPySchemaConf(Schema):
SERVER = fields.Nested(ServerConfig, load_default=ServerConfig().load({}))
MEDIAS = fields.Nested(MediasConfig, load_default=MediasConfig().load({}))
ALEMBIC = fields.Nested(AlembicConfig, load_default=AlembicConfig().load({}))
TAXHUB_API = fields.Nested(TaxhubApiConf, load_default=TaxhubApiConf().load({}))
TAXHUB_CONF = fields.Nested(
TaxhubAppConf, load_default=TaxhubAppConf().load({"API_PREFIX": "/api"})
)

@post_load()
def folders(self, data, **kwargs):
Expand Down
5 changes: 5 additions & 0 deletions config/default_config.toml.example
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,11 @@ MEDIA_CLEAN_CRONTAB = "0 1 * * *"
MY_ORGANISM_DATA = 2
ALL_DATA = 3

# Configuration de taxhub
[TAXHUB_CONF]
# Prefix des routes de l'api de taxhub
API_PREFIX="/api"

# Configuration générale de l'interface de GeoNature
[FRONTEND]
# En mode production (=true) moins de message dans la Console navigateur
Expand Down

0 comments on commit d42392b

Please sign in to comment.