mirror of
https://github.com/Tivix/django-rest-auth.git
synced 2025-04-19 08:12:06 +03:00
Merge efd4d2a1a9
into cdd04aa9be
This commit is contained in:
commit
16c983ca68
|
@ -115,12 +115,13 @@ class LogoutView(APIView):
|
|||
"""
|
||||
permission_classes = (AllowAny,)
|
||||
|
||||
def get(self, request, *args, **kwargs):
|
||||
def __init__(self):
|
||||
if getattr(settings, 'ACCOUNT_LOGOUT_ON_GET', False):
|
||||
response = self.logout(request)
|
||||
else:
|
||||
response = self.http_method_not_allowed(request, *args, **kwargs)
|
||||
self.get = self._get
|
||||
super().__init__()
|
||||
|
||||
def _get(self, request, *args, **kwargs):
|
||||
response = self.logout(request)
|
||||
return self.finalize_response(request, response, *args, **kwargs)
|
||||
|
||||
def post(self, request, *args, **kwargs):
|
||||
|
|
Loading…
Reference in New Issue
Block a user