Commit 7345830c by Tymur Maryokhin

Check if sessions are enabled before calling logout. Closes #2545.

parent dc8cc860
...@@ -209,7 +209,8 @@ class APIClient(APIRequestFactory, DjangoClient): ...@@ -209,7 +209,8 @@ class APIClient(APIRequestFactory, DjangoClient):
self.handler._force_user = None self.handler._force_user = None
self.handler._force_token = None self.handler._force_token = None
return super(APIClient, self).logout() if self.session:
super(APIClient, self).logout()
class APITransactionTestCase(testcases.TransactionTestCase): class APITransactionTestCase(testcases.TransactionTestCase):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment