Skip to content

Commit

Permalink
fix types
Browse files Browse the repository at this point in the history
  • Loading branch information
wizzdom committed Jan 16, 2025
1 parent cbd3cea commit 43ff3fd
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,7 @@ async def hedgedoc_login(aiohttp_client: aiohttp.ClientSession) -> None:
await aiohttp_client.post("https://md.redbrick.dcu.ie/auth/ldap", data=data)


async def get_md_content(
url: str, aiohttp_client: aiohttp.ClientSession
) -> str | tuple[str, urlparse]:
async def get_md_content(url: str, aiohttp_client: aiohttp.ClientSession) -> str:
"""
Get the content of a note at a HedgeDoc URL.
"""
Expand All @@ -51,7 +49,7 @@ async def get_md_content(

async def post_new_md_content(
content: str, aiohttp_client: aiohttp.ClientSession
) -> str:
) -> str | None:
post_url = "https://md.redbrick.dcu.ie/new"
post_headers = {"Content-Type": "text/markdown"}

Expand All @@ -66,8 +64,8 @@ async def post_new_md_content(
)
return None

return await response.url
return str(response.url)


def utcnow() -> datetime.datetime:
return datetime.datetime.now(datetime.timezone.utc)

0 comments on commit 43ff3fd

Please sign in to comment.