From 21f9e80c9ed3851eb4247671abfbd0ccf4682bd9 Mon Sep 17 00:00:00 2001 From: Andrew Shumway Date: Fri, 2 Jun 2023 08:32:44 -0600 Subject: [PATCH] Added hasattr() back for potential NoneType error --- app/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/__init__.py b/app/__init__.py index a8cc7e930..c108d6a8c 100644 --- a/app/__init__.py +++ b/app/__init__.py @@ -315,7 +315,7 @@ def init_app(application): def _attach_current_daily_remaining_messages_per_service(): remaining_messages = 0 - if current_service: + if hasattr(current_service, 'message_limit'): remaining_messages = current_service.message_limit - service_api_client.get_notification_count( service_id=current_service.id)