Skip to content

Commit

Permalink
Rename AuthenticatedRequest to AuthenticatedApiRequest
Browse files Browse the repository at this point in the history
  • Loading branch information
medihack committed Feb 9, 2024
1 parent 684c803 commit 4e7c0d6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion radis/core/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ class AuthenticatedHttpRequest(HtmxHttpRequest):
user: User


class AuthenticatedRequest(Request):
class AuthenticatedApiRequest(Request):
user: User
6 changes: 3 additions & 3 deletions radis/search/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@
from django.views import View

from radis.core.mixins import HtmxOnlyMixin
from radis.core.types import AuthenticatedRequest
from radis.core.types import AuthenticatedApiRequest

from .serializers import SearchParamsSerializer
from .site import Search, SearchHandler, search_handlers


class SearchView(LoginRequiredMixin, View):
def get(self, request: AuthenticatedRequest, *args, **kwargs):
def get(self, request: AuthenticatedApiRequest, *args, **kwargs):
serializer = SearchParamsSerializer(data=request.GET)

if not serializer.is_valid():
Expand Down Expand Up @@ -62,7 +62,7 @@ def get(self, request: AuthenticatedRequest, *args, **kwargs):


class InfoView(LoginRequiredMixin, HtmxOnlyMixin, View):
def post(self, request: AuthenticatedRequest, *args, **kwargs):
def post(self, request: AuthenticatedApiRequest, *args, **kwargs):
algorithm = request.POST.get("algorithm", "")
search_handler = search_handlers.get(algorithm)

Expand Down

0 comments on commit 4e7c0d6

Please sign in to comment.