Skip to content

Commit

Permalink
Upgrade whitenoise dependency.
Browse files Browse the repository at this point in the history
  • Loading branch information
rtibbles committed May 13, 2024
1 parent a915770 commit 996e896
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
6 changes: 2 additions & 4 deletions kolibri/utils/kolibri_whitenoise.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import re
import stat
from collections import OrderedDict
from http import HTTPStatus
from io import BufferedIOBase
from urllib.parse import parse_qs
from urllib.parse import urljoin
Expand All @@ -12,7 +13,6 @@
from django.core.files.storage import FileSystemStorage
from django.utils._os import safe_join
from whitenoise import WhiteNoise
from whitenoise.httpstatus_backport import HTTPStatus
from whitenoise.responders import MissingFileError
from whitenoise.responders import NOT_ALLOWED_RESPONSE
from whitenoise.responders import Response
Expand All @@ -25,8 +25,6 @@

compressed_file_extensions = ("gz",)

not_found_status = HTTPStatus(404, "Not Found")


class NotFoundStaticFile(object):
"""
Expand All @@ -35,7 +33,7 @@ class NotFoundStaticFile(object):
"""

def get_response(self, method, request_headers):
return Response(not_found_status, [], None)
return Response(status=HTTPStatus.NOT_FOUND, headers=[], file=None)


NOT_FOUND = NotFoundStaticFile()
Expand Down
2 changes: 1 addition & 1 deletion requirements/base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ redis==3.2.1
html5lib==1.1
zeroconf-py2compat==0.19.17
Click==7.0
whitenoise==4.1.4
whitenoise==5.3.0
idna==3.7
ifaddr==0.1.7 # Pin as version 0.2.0 only supports Python 3.7 and above
importlib-metadata==2.1.1
Expand Down

0 comments on commit 996e896

Please sign in to comment.