diff options
author | 2023-05-13 14:31:39 +0100 | |
---|---|---|
committer | 2023-05-13 14:34:33 +0100 | |
commit | 509449c1a7d4230c3a4b1e335b681fbecf0313c0 (patch) | |
tree | 27ea2c360723503528ec9b2069dd513b9b26f613 /pydis_site/apps/api/github_utils.py | |
parent | Specify file encoding so tests pass on windows (diff) |
Use the new datetime.UTC alias over datetime.timezone.utc
Diffstat (limited to 'pydis_site/apps/api/github_utils.py')
-rw-r--r-- | pydis_site/apps/api/github_utils.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/pydis_site/apps/api/github_utils.py b/pydis_site/apps/api/github_utils.py index af659195..b1a7d07d 100644 --- a/pydis_site/apps/api/github_utils.py +++ b/pydis_site/apps/api/github_utils.py @@ -82,7 +82,7 @@ def generate_token() -> str: Refer to: https://docs.github.com/en/developers/apps/building-github-apps/authenticating-with-github-apps#authenticating-as-a-github-app """ - now = datetime.datetime.now(tz=datetime.timezone.utc) + now = datetime.datetime.now(tz=datetime.UTC) return jwt.encode( { "iat": math.floor((now - datetime.timedelta(seconds=60)).timestamp()), # Issued at @@ -148,9 +148,9 @@ def check_run_status(run: WorkflowRun) -> str: created_at = ( datetime.datetime .strptime(run.created_at, settings.GITHUB_TIMESTAMP_FORMAT) - .replace(tzinfo=datetime.timezone.utc) + .replace(tzinfo=datetime.UTC) ) - run_time = datetime.datetime.now(tz=datetime.timezone.utc) - created_at + run_time = datetime.datetime.now(tz=datetime.UTC) - created_at if run.status != "completed": if run_time <= MAX_RUN_TIME: |