Use b32encode instead of b32hexencode

As `b32hexencode` only exists on Python >= 3.10, and the server runs 3.9
This commit is contained in:
Adam Goldsmith 2021-12-30 17:56:28 -05:00
parent 33f38bfd5a
commit 6d5321491e

View File

@ -1,6 +1,6 @@
from datetime import datetime
import os.path
from base64 import b32hexencode
from base64 import b32encode
from google.auth.transport.requests import Request
from google.oauth2.credentials import Credentials
@ -47,7 +47,7 @@ class CalendarService:
def insert_or_update_event(
self, calendar_id: str, id: str, title: str, start: datetime, end: datetime
):
event_id = b32hexencode(id.encode("ascii")).decode("ascii").lower().rstrip("=")
event_id = b32encode(id.encode("ascii")).decode("ascii").lower().rstrip("=")
event = {
"id": event_id,
"summary": title,