Skip to content

Commit

Permalink
remove unused functions
Browse files Browse the repository at this point in the history
  • Loading branch information
madjid-asa committed Nov 27, 2024
1 parent 9104492 commit 61ddbc5
Showing 1 changed file with 0 additions and 22 deletions.
22 changes: 0 additions & 22 deletions lemarche/api/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,6 @@
import string

from rest_framework import serializers
from rest_framework.exceptions import APIException

from lemarche.users.models import User


# Custom Service Exceptions
class Unauthorized(APIException):
status_code = 401
default_detail = "Unauthorized"
default_code = "unauthorized"


def check_user_token(token):
"""
User token functionnality is temporary, and only used
to trace API usage and support : once a proper
auth protocol is implemented it will be replaced
"""
try:
return User.objects.has_api_key().get(api_key=token)
except (User.DoesNotExist, AssertionError):
raise Unauthorized


def custom_preprocessing_hook(endpoints):
Expand Down

0 comments on commit 61ddbc5

Please sign in to comment.