From 153059c051e9b14913c0f6cfba40d8b3ae067555 Mon Sep 17 00:00:00 2001 From: Hassan Abouelela Date: Fri, 28 Oct 2022 02:26:10 +0400 Subject: Clean Up Typing Signed-off-by: Hassan Abouelela --- pydis_site/apps/content/utils.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'pydis_site/apps/content/utils.py') diff --git a/pydis_site/apps/content/utils.py b/pydis_site/apps/content/utils.py index d533d95b..8e3b0bd7 100644 --- a/pydis_site/apps/content/utils.py +++ b/pydis_site/apps/content/utils.py @@ -3,7 +3,6 @@ import functools import json import tarfile import tempfile -import typing from io import BytesIO from pathlib import Path @@ -218,10 +217,10 @@ def get_tags() -> list[Tag]: return tags else: # Get tags from database - return Tag.objects.all() + return list(Tag.objects.all()) -def get_tag(path: str, *, skip_sync: bool = False) -> typing.Union[Tag, list[Tag]]: +def get_tag(path: str, *, skip_sync: bool = False) -> Tag | list[Tag]: """ Return a tag based on the search location. @@ -255,9 +254,7 @@ def get_tag(path: str, *, skip_sync: bool = False) -> typing.Union[Tag, list[Tag raise Tag.DoesNotExist() -def get_tag_category( - tags: typing.Optional[list[Tag]] = None, *, collapse_groups: bool -) -> dict[str, dict]: +def get_tag_category(tags: list[Tag] | None = None, *, collapse_groups: bool) -> dict[str, dict]: """ Generate context data for `tags`, or all tags if None. -- cgit v1.2.3