66"""
77
88import abc
9+ import datetime
910import functools
1011import importlib
1112import json
1213import logging
1314import os
1415import re
1516from collections .abc import Iterable , Mapping
16- from datetime import timedelta
1717from pathlib import Path
1818from typing import TYPE_CHECKING , final
1919
@@ -570,7 +570,7 @@ def _setup_auto_su_platform_access_cookie_checking_interval(cls) -> None:
570570 }
571571
572572 if (
573- timedelta (
573+ datetime . timedelta (
574574 ** raw_timedelta_auto_su_platform_access_cookie_checking_interval
575575 ).total_seconds ()
576576 <= 3
@@ -624,7 +624,9 @@ def _setup_send_introduction_reminders_delay(cls) -> None:
624624 .replace (" " , "" ),
625625 )
626626
627- raw_timedelta_send_introduction_reminders_delay : timedelta = timedelta ()
627+ raw_timedelta_send_introduction_reminders_delay : datetime .timedelta = (
628+ datetime .timedelta ()
629+ )
628630
629631 if cls ._settings ["SEND_INTRODUCTION_REMINDERS" ]:
630632 if not raw_send_introduction_reminders_delay :
@@ -636,15 +638,15 @@ def _setup_send_introduction_reminders_delay(cls) -> None:
636638 INVALID_SEND_INTRODUCTION_REMINDERS_DELAY_MESSAGE
637639 )
638640
639- raw_timedelta_send_introduction_reminders_delay = timedelta (
641+ raw_timedelta_send_introduction_reminders_delay = datetime . timedelta (
640642 ** {
641643 key : float (value )
642644 for key , value in raw_send_introduction_reminders_delay .groupdict ().items ()
643645 if value
644646 }
645647 )
646648
647- if raw_timedelta_send_introduction_reminders_delay < timedelta (days = 1 ):
649+ if raw_timedelta_send_introduction_reminders_delay < datetime . timedelta (days = 1 ):
648650 TOO_SMALL_SEND_INTRODUCTION_REMINDERS_DELAY_MESSAGE : Final [str ] = (
649651 "SEND_INTRODUCTION_REMINDERS_DELAY must be longer than or equal to 1 day."
650652 )
@@ -694,7 +696,7 @@ def _setup_send_introduction_reminders_interval(cls) -> None:
694696 }
695697
696698 if (
697- timedelta (
699+ datetime . timedelta (
698700 ** raw_timedelta_details_send_introduction_reminders_interval
699701 ).total_seconds ()
700702 <= 3
@@ -741,7 +743,7 @@ def _setup_send_get_roles_reminders_delay(cls) -> None:
741743 .replace (" " , "" ),
742744 )
743745
744- raw_timedelta_send_get_roles_reminders_delay : timedelta = timedelta ()
746+ raw_timedelta_send_get_roles_reminders_delay : datetime . timedelta = datetime . timedelta ()
745747
746748 if cls ._settings ["SEND_GET_ROLES_REMINDERS" ]:
747749 if not raw_send_get_roles_reminders_delay :
@@ -751,15 +753,15 @@ def _setup_send_get_roles_reminders_delay(cls) -> None:
751753 )
752754 raise ImproperlyConfiguredError (INVALID_SEND_GET_ROLES_REMINDERS_DELAY_MESSAGE )
753755
754- raw_timedelta_send_get_roles_reminders_delay = timedelta (
756+ raw_timedelta_send_get_roles_reminders_delay = datetime . timedelta (
755757 ** {
756758 key : float (value )
757759 for key , value in raw_send_get_roles_reminders_delay .groupdict ().items ()
758760 if value
759761 }
760762 )
761763
762- if raw_timedelta_send_get_roles_reminders_delay < timedelta (days = 1 ):
764+ if raw_timedelta_send_get_roles_reminders_delay < datetime . timedelta (days = 1 ):
763765 TOO_SMALL_SEND_GET_ROLES_REMINDERS_DELAY_MESSAGE : Final [str ] = (
764766 "SEND_GET_ROLES_REMINDERS_DELAY must be longer than or equal to 1 day."
765767 )
@@ -831,7 +833,7 @@ def _setup_statistics_days(cls) -> None:
831833 )
832834 raise ImproperlyConfiguredError (TOO_SMALL_STATISTICS_DAYS_MESSAGE )
833835
834- cls ._settings ["STATISTICS_DAYS" ] = timedelta (days = raw_statistics_days )
836+ cls ._settings ["STATISTICS_DAYS" ] = datetime . timedelta (days = raw_statistics_days )
835837
836838 @classmethod
837839 def _setup_statistics_roles (cls ) -> None :
0 commit comments