diff --git a/apps/authorization/views/common.py b/apps/authorization/views/common.py index ada56ea3..f119b0fd 100644 --- a/apps/authorization/views/common.py +++ b/apps/authorization/views/common.py @@ -181,10 +181,8 @@ class LoginByUsernameOrEmailView(JWTGenericViewMixin, generics.GenericAPIView): def post(self, request, *args, **kwargs): """ - #Login view. - *** - ##Available HTTP methods: POST - POST-request data: + ## Login view. + POST-request data ``` { "username_or_email": , @@ -193,6 +191,14 @@ class LoginByUsernameOrEmailView(JWTGenericViewMixin, generics.GenericAPIView): "source": # 0 - Mobile, 1 - Web, 2 - All (by default used: 1) } ``` + ## Response + After a successful login, server side set up access_token and refresh token to cookies. + In a payload of access token, the following information is being embed: + see `User().get_user_info()`. + + COOKIE Max-age are determined by `remember` flag: + if `remember` is `True` then `Max-age` parameter taken from `settings.COOKIES_MAX_AGE` + otherwise using session COOKIE Max-age. """ serializer = self.get_serializer(data=request.data) serializer.is_valid(raise_exception=True) diff --git a/apps/collection/filters.py b/apps/collection/filters.py index 66b5e454..24d73a08 100644 --- a/apps/collection/filters.py +++ b/apps/collection/filters.py @@ -1,6 +1,6 @@ """Collection app filters.""" -from django_filters import rest_framework as filters from django.core.validators import EMPTY_VALUES +from django_filters import rest_framework as filters from collection import models @@ -37,7 +37,7 @@ class GuideFilterSet(filters.FilterSet): """Guide filter set.""" establishment_id = filters.NumberFilter( method='by_establishment_id', - help_text='Establishment id. Allows to filter list of guides by choosen establishment. ' + help_text='Establishment id. It allows filtering list of guides by choosen establishment. ' 'Use for Establishment detail\'s sheet to content display within ' '"Collections & Guides" tab.' ) diff --git a/apps/collection/views/back.py b/apps/collection/views/back.py index 53b9bafd..7f1e9f45 100644 --- a/apps/collection/views/back.py +++ b/apps/collection/views/back.py @@ -115,6 +115,7 @@ class GuideListView(generics.ListAPIView): """View for Guides list.""" pagination_class = None serializer_class = serializers.GuideShortSerializer + filter_class = filters.GuideFilterSet def get_queryset(self): """An overridden get_queryset method."""