mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-24 08:16:51 -04:00
Compare commits
2 Commits
da695557b0
...
d4a2584dfb
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d4a2584dfb | ||
|
|
638a4f20da |
@@ -50,7 +50,8 @@ def index():
|
||||
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"}
|
||||
counts = None
|
||||
print(counts)
|
||||
return render_template(
|
||||
"views/signedout.html",
|
||||
sms_rate=CURRENT_SMS_RATE,
|
||||
|
||||
@@ -8,7 +8,7 @@ import usaButton %} {% block meta %}
|
||||
{% block beforeContent %}{% endblock %}
|
||||
|
||||
<main id="main-content" role="main">
|
||||
{% if counts.live_service_count == 'N/A' %}
|
||||
{% if counts %}
|
||||
<div class="usa-alert usa-alert--info usa-alert--slim" aria-label="Site alert,,,,">
|
||||
<div class="grid-container padding-x-0">
|
||||
<div class="usa-alert__body">
|
||||
|
||||
@@ -15,6 +15,7 @@ class ColorFormatter(logging.Formatter):
|
||||
'DEBUG': '\033[94m',
|
||||
'WARNING': '\033[93m',
|
||||
'ERROR': '\033[91m',
|
||||
'CRITICAL': '\033[95m',
|
||||
}
|
||||
RESET = '\033[0m'
|
||||
|
||||
@@ -93,7 +94,6 @@ def init_app(app):
|
||||
|
||||
def get_handlers(app):
|
||||
handlers = []
|
||||
color_formatter = ColorFormatter(LOG_FORMAT, TIME_FORMAT)
|
||||
json_formatter = JSONFormatter(LOG_FORMAT, TIME_FORMAT)
|
||||
|
||||
stream_handler = logging.StreamHandler(sys.stdout)
|
||||
@@ -106,6 +106,8 @@ def get_handlers(app):
|
||||
return not ("GET /static/" in msg and " 200 " in msg)
|
||||
|
||||
logging.getLogger("werkzeug").addFilter(is_200_static_log)
|
||||
color_formatter = ColorFormatter(LOG_FORMAT, TIME_FORMAT)
|
||||
|
||||
handlers.append(configure_handler(stream_handler, app, color_formatter))
|
||||
|
||||
return handlers
|
||||
|
||||
Reference in New Issue
Block a user