Skip to content

Commit

Permalink
Allow configuring qwc config schema
Browse files Browse the repository at this point in the history
  • Loading branch information
manisandro committed Aug 1, 2024
1 parent 57b70b7 commit 1beabcd
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
flask_login==0.6.3
jsonschema==4.20.0
psycopg2==2.9.9
qwc-services-core==1.3.29
qwc-services-core==1.3.30
requests==2.32.0
SQLAlchemy==2.0.29
Flask==3.0.0
Expand Down
4 changes: 4 additions & 0 deletions schemas/qwc-config-generator.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@
"type": "string",
"format": "uri"
},
"qwc_config_schema": {
"description": "The name of the DB schema which stores the qwc config. Default: qwc_config",
"type": "string"
},
"default_qgis_server_url": {
"description": "Default QGIS Server URL for OGC requests. Example: http://qwc-qgis-server/ows/",
"type": "string",
Expand Down
6 changes: 5 additions & 1 deletion src/config_generator/config_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,7 @@ def __init__(self, config, logger, config_file_dir):
os.environ.get(
'OUTPUT_CONFIG_PATH', '/tmp/'
))
self.qwc_config_schema = generator_config.get('qwc_config_schema', 'qwc_config')
self.tenant_path = os.path.join(self.config_path, self.tenant)
self.logger.info("Config destination: '%s'" % self.tenant_path)

Expand All @@ -226,7 +227,10 @@ def __init__(self, config, logger, config_file_dir):
'config_db_url', 'postgresql:///?service=qwc_configdb'
)
db_engine = DatabaseEngine()
self.config_models = ConfigModels(db_engine, config_db_url)
self.config_models = ConfigModels(
db_engine, config_db_url,
qwc_config_schema=self.qwc_config_schema
)
except Exception as e:
msg = (
"Could not load ConfigModels for ConfigDB at '%s':\n%s" %
Expand Down

0 comments on commit 1beabcd

Please sign in to comment.