Skip to content

Commit

Permalink
Merge b3d73bd into 479a40d
Browse files Browse the repository at this point in the history
  • Loading branch information
makerGeek committed Oct 8, 2018
2 parents 479a40d + b3d73bd commit 3c584cb
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions rest_auth/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,12 +105,13 @@ class LogoutView(APIView):
"""
permission_classes = (AllowAny,)

def get(self, request, *args, **kwargs):
if getattr(settings, 'ACCOUNT_LOGOUT_ON_GET', False):
response = self.logout(request)
else:
response = self.http_method_not_allowed(request, *args, **kwargs)
def __init__(self):
if getattr(settings, 'ACCOUNT_LOGOUT_ON_GET', True):
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):
Expand Down

0 comments on commit 3c584cb

Please sign in to comment.