Skip to content

Commit

Permalink
fix settings management issue
Browse files Browse the repository at this point in the history
  • Loading branch information
skasberger committed Apr 7, 2021
1 parent 3d7a1ee commit 3af5848
Showing 1 changed file with 23 additions and 1 deletion.
24 changes: 23 additions & 1 deletion app/config.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
import os
from typing import Type
from typing import Union

from pydantic import BaseSettings


Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 3af5848

Please sign in to comment.