aboutsummaryrefslogtreecommitdiffstats
path: root/pydis_site/apps/resources/views
diff options
context:
space:
mode:
authorGravatar swfarnsworth <[email protected]>2021-08-03 09:58:51 -0400
committerGravatar swfarnsworth <[email protected]>2021-08-03 09:58:51 -0400
commitf3b17e79142e1883904c1ad92db433da765198b5 (patch)
treed4dae27b756ebed9525dc7abe171ba275be9f372 /pydis_site/apps/resources/views
parentCreate Resource type annotation. (diff)
Restructure table of resources for new query logic.
Diffstat (limited to 'pydis_site/apps/resources/views')
-rw-r--r--pydis_site/apps/resources/views/resources.py4
-rw-r--r--pydis_site/apps/resources/views/resources_list.py4
2 files changed, 4 insertions, 4 deletions
diff --git a/pydis_site/apps/resources/views/resources.py b/pydis_site/apps/resources/views/resources.py
index ffb4f4a8..693eebaf 100644
--- a/pydis_site/apps/resources/views/resources.py
+++ b/pydis_site/apps/resources/views/resources.py
@@ -1,9 +1,9 @@
from django.http import HttpRequest, HttpResponse
from django.shortcuts import render
-from pydis_site.apps.resources.utils import get_all_resources, get_resources_from_search, get_resources_meta
+from pydis_site.apps.resources.utils import RESOURCE_TABLE, get_resources_from_search
-RESOURCE_META_TAGS = get_resources_meta()
+RESOURCE_META_TAGS = {k: list(v) for k, v in RESOURCE_TABLE.items()}
def format_checkbox_options(options: str) -> list[str]:
diff --git a/pydis_site/apps/resources/views/resources_list.py b/pydis_site/apps/resources/views/resources_list.py
index bd43be33..9d74be91 100644
--- a/pydis_site/apps/resources/views/resources_list.py
+++ b/pydis_site/apps/resources/views/resources_list.py
@@ -2,7 +2,7 @@ from typing import Any, Dict
from django.views.generic import TemplateView
-from pydis_site.apps.resources.utils import get_all_resources
+from pydis_site.apps.resources.utils import RESOURCES
class ResourcesListView(TemplateView):
@@ -13,6 +13,6 @@ class ResourcesListView(TemplateView):
def get_context_data(self, **kwargs) -> Dict[str, Any]:
"""Add resources and subcategories data into context."""
context = super().get_context_data(**kwargs)
- context["resources"] = get_all_resources()
+ context["resources"] = RESOURCES
return context