aboutsummaryrefslogtreecommitdiffstats
path: root/pydis_site/apps/content/utils.py
diff options
context:
space:
mode:
authorGravatar Hassan Abouelela <[email protected]>2022-08-13 08:47:29 +0200
committerGravatar Hassan Abouelela <[email protected]>2022-08-13 20:42:58 +0200
commita8fd8b823748ced96bb8ea34e8dcd8bd0dd57671 (patch)
tree0cb2b2bba90b00a9ad6617844f05e1098d00398f /pydis_site/apps/content/utils.py
parentExport Tag Model As Top Level Model Object (diff)
Add Tag View Tests
Signed-off-by: Hassan Abouelela <[email protected]>
Diffstat (limited to 'pydis_site/apps/content/utils.py')
-rw-r--r--pydis_site/apps/content/utils.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/pydis_site/apps/content/utils.py b/pydis_site/apps/content/utils.py
index de609596..76437593 100644
--- a/pydis_site/apps/content/utils.py
+++ b/pydis_site/apps/content/utils.py
@@ -56,7 +56,7 @@ def fetch_tags() -> list[Tag]:
The entire repository is downloaded and extracted locally because
getting file content would require one request per file, and can get rate-limited.
"""
- if settings.GITHUB_TOKEN:
+ if settings.GITHUB_TOKEN: # pragma: no cover
headers = {"Authorization": f"token {settings.GITHUB_TOKEN}"}
else:
headers = {}
@@ -90,7 +90,7 @@ def fetch_tags() -> list[Tag]:
def get_tags() -> list[Tag]:
"""Return a list of all tags visible to the application, from the cache or API."""
- if settings.STATIC_BUILD:
+ if settings.STATIC_BUILD: # pragma: no cover
last_update = None
else:
last_update = (
@@ -100,7 +100,7 @@ def get_tags() -> list[Tag]:
if last_update is None or timezone.now() >= (last_update + TAG_CACHE_TTL):
# Stale or empty cache
- if settings.STATIC_BUILD:
+ if settings.STATIC_BUILD: # pragma: no cover
tags = get_tags_static()
else:
tags = fetch_tags()