diff options
author | 2023-05-17 12:11:32 +0530 | |
---|---|---|
committer | 2023-05-17 12:11:32 +0530 | |
commit | 763027f43a843fee1902834354e849dd1772e495 (patch) | |
tree | 7a06695aab0a5111d9b69b9c5034b9bfc4ed3294 /pydis_site/apps/api/github_utils.py | |
parent | give a simple introduction to cogs and example links (diff) | |
parent | Merge pull request #976 from python-discord/dependabot/pip/sentry-sdk-1.23.0 (diff) |
Merge branch 'main' into subclassing_bot
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: |