From 2fd2af793e198880c76a91b55e0a32cfd534a6b1 Mon Sep 17 00:00:00 2001 From: Aaron Kable Date: Sun, 21 Feb 2021 18:14:42 +0800 Subject: [PATCH] Use default by defaut in notification system --- .../notifications/templatetags/auth_notifications.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/allianceauth/notifications/templatetags/auth_notifications.py b/allianceauth/notifications/templatetags/auth_notifications.py index ddfabec7..c2c5ee5f 100644 --- a/allianceauth/notifications/templatetags/auth_notifications.py +++ b/allianceauth/notifications/templatetags/auth_notifications.py @@ -33,10 +33,8 @@ def user_unread_notification_count(user: object) -> int: @register.simple_tag def notifications_refresh_time() -> int: - refresh_time = getattr(settings, 'NOTIFICATIONS_REFRESH_TIME', None) - if ( - refresh_time is None or not isinstance(refresh_time, int) or refresh_time < 0 - ): + refresh_time = getattr(settings, 'NOTIFICATIONS_REFRESH_TIME', Notification.NOTIFICATIONS_REFRESH_TIME_DEFAULT) + if (not isinstance(refresh_time, int) or refresh_time < 0): logger.warning('NOTIFICATIONS_REFRESH_TIME setting is invalid. Using default.') refresh_time = Notification.NOTIFICATIONS_REFRESH_TIME_DEFAULT