diff options
author | 2022-08-21 22:56:16 +0400 | |
---|---|---|
committer | 2022-09-30 18:48:02 +0400 | |
commit | cd815d3e928e8f83e74f10389110ddb615199342 (patch) | |
tree | 4f60250c0186930578f2d616a3104437caa67678 /pydis_site/apps | |
parent | Bump Developer Dependencies (diff) |
Fix Static Build
Remove all unnecessary middleware and return a proper response for
redirects to fix static builds.
Signed-off-by: Hassan Abouelela <[email protected]>
Diffstat (limited to 'pydis_site/apps')
-rw-r--r-- | pydis_site/apps/redirect/urls.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/pydis_site/apps/redirect/urls.py b/pydis_site/apps/redirect/urls.py index f7ddf45b..f86fe665 100644 --- a/pydis_site/apps/redirect/urls.py +++ b/pydis_site/apps/redirect/urls.py @@ -3,6 +3,7 @@ import re import yaml from django import conf +from django.http import HttpResponse from django.urls import URLPattern, path from django_distill import distill_path @@ -53,7 +54,7 @@ def map_redirect(name: str, data: Redirect) -> list[URLPattern]: class RedirectFunc: def __init__(self, new_url: str, _name: str): - self.result = REDIRECT_TEMPLATE.format(url=new_url) + self.result = HttpResponse(REDIRECT_TEMPLATE.format(url=new_url)) self.__qualname__ = _name def __call__(self, *args, **kwargs): @@ -95,7 +96,7 @@ def map_redirect(name: str, data: Redirect) -> list[URLPattern]: return [distill_path( data.original_path, - lambda *args: REDIRECT_TEMPLATE.format(url=new_redirect), + lambda *args: HttpResponse(REDIRECT_TEMPLATE.format(url=new_redirect)), name=name, )] |