diff --git a/selfprivacy_api/backup/tasks.py b/selfprivacy_api/backup/tasks.py index 0f73178..47063b3 100644 --- a/selfprivacy_api/backup/tasks.py +++ b/selfprivacy_api/backup/tasks.py @@ -1,7 +1,7 @@ """ The tasks module contains the worker tasks that are used to back up and restore """ -from datetime import datetime +from datetime import datetime, timezone from selfprivacy_api.graphql.common_types.backup import RestoreStrategy @@ -15,13 +15,8 @@ def validate_datetime(dt: datetime) -> bool: """ Validates that the datetime passed in is timezone-aware. """ - if dt.timetz is None: - raise ValueError( - """ - huey passed in the timezone-unaware time! - Post it in support chat or maybe try uncommenting a line above - """ - ) + if dt.tzinfo is None: + return Backups.is_time_to_backup(dt.replace(tzinfo=timezone.utc)) return Backups.is_time_to_backup(dt) diff --git a/selfprivacy_api/utils/huey.py b/selfprivacy_api/utils/huey.py index 034f7ba..a7ff492 100644 --- a/selfprivacy_api/utils/huey.py +++ b/selfprivacy_api/utils/huey.py @@ -11,4 +11,5 @@ test_mode = os.environ.get("TEST_MODE") huey = SqliteHuey( HUEY_DATABASE, immediate=test_mode == "true", + utc=True, )