aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Leon Sandøy <[email protected]>2022-01-29 14:55:01 +0100
committerGravatar Leon Sandøy <[email protected]>2022-01-29 14:55:01 +0100
commit325d7076ee7b426e50fdf513caed07536bfdb9b5 (patch)
treeac4aebe99bba142c0892e3fbcc1b52cb645e6948
parentComplexity -> Difficulty. (diff)
Sort all the resources alphabetically.
-rw-r--r--pydis_site/apps/resources/tests/test_views.py1
-rw-r--r--pydis_site/apps/resources/views/resources.py5
2 files changed, 4 insertions, 2 deletions
diff --git a/pydis_site/apps/resources/tests/test_views.py b/pydis_site/apps/resources/tests/test_views.py
index f96a04b0..dab3599d 100644
--- a/pydis_site/apps/resources/tests/test_views.py
+++ b/pydis_site/apps/resources/tests/test_views.py
@@ -1,5 +1,4 @@
from pathlib import Path
-from unittest.mock import patch
from django.conf import settings
from django.test import TestCase
diff --git a/pydis_site/apps/resources/views/resources.py b/pydis_site/apps/resources/views/resources.py
index 14b3d0bf..d0b8bae7 100644
--- a/pydis_site/apps/resources/views/resources.py
+++ b/pydis_site/apps/resources/views/resources.py
@@ -2,7 +2,7 @@ from pathlib import Path
import yaml
from django.core.handlers.wsgi import WSGIRequest
-from django.http import HttpRequest, HttpResponse
+from django.http import HttpResponse
from django.shortcuts import render
from django.views import View
@@ -24,6 +24,9 @@ class ResourceView(View):
for path in RESOURCES_PATH.rglob("*.yaml")
}
+ # Sort the resources alphabetically
+ self.resources = dict(sorted(self.resources.items()))
+
# Parse out all current tags
resource_tags = {
"topics": set(),