allow config dictionary as argument to make_config; disable CRLs for scripts
This commit is contained in:
parent
6e6b5948b1
commit
80f633f457
@ -139,7 +139,7 @@ def map_config(config):
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
def make_config():
|
def make_config(direct_config=None):
|
||||||
BASE_CONFIG_FILENAME = os.path.join(os.path.dirname(__file__), "../config/base.ini")
|
BASE_CONFIG_FILENAME = os.path.join(os.path.dirname(__file__), "../config/base.ini")
|
||||||
ENV_CONFIG_FILENAME = os.path.join(
|
ENV_CONFIG_FILENAME = os.path.join(
|
||||||
os.path.dirname(__file__), "../config/", "{}.ini".format(ENV.lower())
|
os.path.dirname(__file__), "../config/", "{}.ini".format(ENV.lower())
|
||||||
@ -162,6 +162,10 @@ def make_config():
|
|||||||
if env_override:
|
if env_override:
|
||||||
config.set("default", confsetting, env_override)
|
config.set("default", confsetting, env_override)
|
||||||
|
|
||||||
|
# override if a dictionary of options has been given
|
||||||
|
if direct_config:
|
||||||
|
config.read_dict({"default": direct_config})
|
||||||
|
|
||||||
# Assemble DATABASE_URI value
|
# Assemble DATABASE_URI value
|
||||||
database_uri = (
|
database_uri = (
|
||||||
"postgres://"
|
"postgres://"
|
||||||
|
@ -153,7 +153,7 @@ def remove_sample_data(all_users=False):
|
|||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
config = make_config()
|
config = make_config({"DISABLE_CRL_CHECK": True})
|
||||||
app = make_app(config)
|
app = make_app(config)
|
||||||
with app.app_context():
|
with app.app_context():
|
||||||
remove_sample_data()
|
remove_sample_data()
|
||||||
|
@ -31,7 +31,7 @@ def seed_roles():
|
|||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
config = make_config()
|
config = make_config({"DISABLE_CRL_CHECK": True})
|
||||||
app = make_app(config)
|
app = make_app(config)
|
||||||
with app.app_context():
|
with app.app_context():
|
||||||
seed_roles()
|
seed_roles()
|
||||||
|
@ -163,7 +163,7 @@ def seed_db():
|
|||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
config = make_config()
|
config = make_config({"DISABLE_CRL_CHECK": True})
|
||||||
app = make_app(config)
|
app = make_app(config)
|
||||||
with app.app_context():
|
with app.app_context():
|
||||||
seed_db()
|
seed_db()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user