mirror of
https://github.com/Tivix/django-rest-auth.git
synced 2024-11-22 09:06:40 +03:00
Prevent logout GET from getting documented by schema generation
...by preventing `get` from being implemented if ACCOUNT_LOGOUT_ON_GET is False
This commit is contained in:
parent
42d039b473
commit
76fd218958
|
@ -105,13 +105,10 @@ class LogoutView(APIView):
|
|||
"""
|
||||
permission_classes = (AllowAny,)
|
||||
|
||||
def get(self, request, *args, **kwargs):
|
||||
if getattr(settings, 'ACCOUNT_LOGOUT_ON_GET', False):
|
||||
if getattr(settings, 'ACCOUNT_LOGOUT_ON_GET', False):
|
||||
def get(self, request, *args, **kwargs):
|
||||
response = self.logout(request)
|
||||
else:
|
||||
response = self.http_method_not_allowed(request, *args, **kwargs)
|
||||
|
||||
return self.finalize_response(request, response, *args, **kwargs)
|
||||
return self.finalize_response(request, response, *args, **kwargs)
|
||||
|
||||
def post(self, request):
|
||||
return self.logout(request)
|
||||
|
|
Loading…
Reference in New Issue
Block a user