aboutsummaryrefslogtreecommitdiffstats
path: root/pydis_site/apps/api/github_utils.py
diff options
context:
space:
mode:
authorGravatar RohanJnr <[email protected]>2023-05-17 12:18:14 +0530
committerGravatar RohanJnr <[email protected]>2023-05-17 12:18:14 +0530
commit5c87be603527b8366affc6ea89343d82b91baf35 (patch)
tree332b3ae1748d9381ef4bdf10f3c756ac8617d1ab /pydis_site/apps/api/github_utils.py
parentsatisfy linter (diff)
parentMerge branch 'main' into subclassing_bot (diff)
Merge branch 'subclassing_bot' of github.com:Diabolical5777/site into subclassing_bot
Diffstat (limited to 'pydis_site/apps/api/github_utils.py')
-rw-r--r--pydis_site/apps/api/github_utils.py6
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: