Added hasattr() back for potential NoneType error

This commit is contained in:
Andrew Shumway
2023-06-02 08:32:44 -06:00
parent a1484c62bb
commit 21f9e80c9e

View File

@@ -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)