Skip to content

Commit

Permalink
Remove unused method
Browse files Browse the repository at this point in the history
Method uses feature of Django > 2, so the apikeyclient cannot
be used for the legacy Django projects that are still using Django 2.

Luckily, the method was not used anymore, so could be removed.
  • Loading branch information
jjmurre committed Oct 25, 2023
1 parent b192741 commit c849609
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 9 deletions.
2 changes: 1 addition & 1 deletion apikeyclient/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ requires = ["setuptools", "wheel"]

[project]
name = "datadiensten-apikeyclient"
version = "0.3.4"
version = "0.3.5"
description = "Client for Datadiensten apikeyserv"
dependencies = ['pause>=0.3', 'requests', 'PyJWT[crypto]==2.8.0', 'build']

Expand Down
9 changes: 1 addition & 8 deletions apikeyclient/src/apikeyclient/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
import threading

from django.conf import settings
from django.http import HttpRequest, HttpResponse, JsonResponse
from django.http.request import MediaType
from django.http import HttpRequest, JsonResponse
import jwt
import pause
import requests
Expand Down Expand Up @@ -62,12 +61,6 @@ def __call__(self, request: HttpRequest):
return JsonResponse({"message": "invalid API key"}, status=HTTPStatus.BAD_REQUEST)
return self._get_response(request)

def _has_explicit_html_media_type(self, media_types: list[MediaType]):
for media_type in media_types:
if media_type.main_type == "text" and media_type.sub_type == "html":
return True
return False

def _fetch_client(self):
apikey_localkeys = getattr(settings, "APIKEY_LOCALKEYS", None)
if apikey_localkeys is not None:
Expand Down

0 comments on commit c849609

Please sign in to comment.