aboutsummaryrefslogtreecommitdiffstats
path: root/pydis_site/apps/content/utils.py
diff options
context:
space:
mode:
authorGravatar Hassan Abouelela <[email protected]>2022-10-28 02:26:10 +0400
committerGravatar Hassan Abouelela <[email protected]>2022-10-28 02:26:10 +0400
commit153059c051e9b14913c0f6cfba40d8b3ae067555 (patch)
tree513ae8646c372bd490715e2f90f56b1c8abc8feb /pydis_site/apps/content/utils.py
parentUpdate pydis_site/apps/content/utils.py (diff)
Clean Up Typing
Signed-off-by: Hassan Abouelela <[email protected]>
Diffstat (limited to 'pydis_site/apps/content/utils.py')
-rw-r--r--pydis_site/apps/content/utils.py9
1 files changed, 3 insertions, 6 deletions
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.