From 3af5848939409f3259b8f3a94ad71d3a81bd3ddc Mon Sep 17 00:00:00 2001 From: Stefan Kasberger Date: Thu, 8 Apr 2021 01:02:01 +0200 Subject: [PATCH] fix settings management issue --- app/config.py | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/app/config.py b/app/config.py index 9890c28..0966459 100755 --- a/app/config.py +++ b/app/config.py @@ -1,4 +1,7 @@ import os +from typing import Type +from typing import Union + from pydantic import BaseSettings @@ -141,7 +144,26 @@ def init_app(cls, app): DockerConfig.init_app(app) -def get_config_class(config_name="default"): +ConfigTypes: Type[ + Union[ + DevelopmentConfig, + TestingConfig, + ProductionConfig, + UnixConfig, + DockerConfig, + DockerComposeConfig, + ] +] = Union[ + DevelopmentConfig, + TestingConfig, + ProductionConfig, + UnixConfig, + DockerConfig, + DockerComposeConfig, +] + + +def get_config_class(config_name: str = "default") -> ConfigTypes: configs = { "development": DevelopmentConfig, "testing": TestingConfig,