Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Split Earth.textproto to NL specific config #2374

Merged
merged 14 commits into from
Mar 6, 2023
12 changes: 7 additions & 5 deletions server/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def register_routes_custom_dc(app):
pass


def register_routes_stanford_dc(app, is_local):
def register_routes_disasters(app):
# Install blueprints specific to Stanford DC
from server.routes import disasters
from server.routes import event
Expand All @@ -98,8 +98,8 @@ def register_routes_stanford_dc(app, is_local):
return

# load disaster dashboard configs
disaster_dashboard_configs = libutil.get_disaster_dashboard_configs()
app.config['DISASTER_DASHBOARD_CONFIGS'] = disaster_dashboard_configs
disaster_dashboard_config = libutil.get_disaster_dashboard_config()
app.config['DISASTER_DASHBOARD_CONFIG'] = disaster_dashboard_config

if app.config['INTEGRATION']:
return
Expand Down Expand Up @@ -211,12 +211,12 @@ def create_app():
register_routes_custom_dc(app)
if (cfg.ENV == 'stanford' or os.environ.get('ENABLE_MODEL') == 'true' or
cfg.LOCAL and not cfg.LITE):
register_routes_stanford_dc(app, cfg.LOCAL)
register_routes_disasters(app)

if cfg.TEST or cfg.INTEGRATION:
# disaster dashboard tests require stanford's routes to be registered.
register_routes_base_dc(app)
register_routes_stanford_dc(app, cfg.LOCAL)
register_routes_disasters(app)
else:
register_routes_base_dc(app)

Expand Down Expand Up @@ -297,6 +297,8 @@ def create_app():

nl_model = nl.Model()
app.config['NL_MODEL'] = nl_model
# This also requires disaster and event routes.
app.config['NL_DISASTER_CONFIG'] = libutil.get_nl_disaster_config()

if not cfg.TEST:
urls = get_health_check_urls()
Expand Down
Loading