Skip to content

Commit

Permalink
Allow configuring qwc config schema in service config
Browse files Browse the repository at this point in the history
  • Loading branch information
manisandro committed Aug 1, 2024
1 parent 444f7f8 commit 510a5d3
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ Flask-JWT-Extended==4.6.0
flask-restx==1.3.0
psycopg2==2.9.9
SQLAlchemy==2.0.29
qwc-services-core==1.3.29
qwc-services-core==1.3.30
4 changes: 4 additions & 0 deletions schemas/qwc-permalink-service.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@
"description": "DB connection URL. Defaults to postgresql:///?service=qwc_configdb.",
"type": "string"
},
"qwc_config_schema": {
"description": "The name of the DB schema which stores the qwc config. Default: qwc_config",
"type": "string"
},
"permalinks_table": {
"description": "Permalink table. Defaults to qwc_config.permalinks.",
"type": "string"
Expand Down
4 changes: 2 additions & 2 deletions src/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@
from qwc_services_core.runtime_config import RuntimeConfig


qwc_config_schema = os.getenv("QWC_CONFIG_SCHEMA", "qwc_config")

# Flask application
app = Flask(__name__)
api = Api(app, version='1.0', title='Permalink API',
Expand Down Expand Up @@ -53,6 +51,8 @@ def db_conn():
config = config_handler.tenant_config(tenant)

db_url = config.get('db_url', 'postgresql:///?service=qwc_configdb')
qwc_config_schema = config.get('qwc_config_schema', 'qwc_config')

permalinks_table = config.get('permalinks_table', qwc_config_schema + '.permalinks')
user_permalink_table = config.get(
'user_permalink_table', qwc_config_schema + '.user_permalinks')
Expand Down

0 comments on commit 510a5d3

Please sign in to comment.