mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-05-05 16:38:59 -04:00
keep landing page independent from api
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
import logging
|
||||
|
||||
from flask import (
|
||||
abort,
|
||||
current_app,
|
||||
@@ -19,6 +21,8 @@ from app.main.views.sub_navigation_dictionaries import (
|
||||
)
|
||||
from app.utils.user import user_is_logged_in
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
# Hook to check for feature flags
|
||||
@main.before_request
|
||||
@@ -42,10 +46,15 @@ def index():
|
||||
if current_user and current_user.is_authenticated:
|
||||
return redirect(url_for("main.choose_account"))
|
||||
|
||||
try:
|
||||
counts = status_api_client.get_count_of_live_services_and_organizations()
|
||||
except Exception as e:
|
||||
logger.warning(f"API down when loading homepage: {e}")
|
||||
counts = {"live_service_count": "N/A", "live_organization_count": "N/A"}
|
||||
return render_template(
|
||||
"views/signedout.html",
|
||||
sms_rate=CURRENT_SMS_RATE,
|
||||
counts=status_api_client.get_count_of_live_services_and_organizations(),
|
||||
counts=counts,
|
||||
)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user