Skip to content

Commit 6bdee6d

Browse files
committed
renamed OAuthLibMixin attribute 'oauthlib_core_class' to 'oauthlib_backend_class'
1 parent df9e752 commit 6bdee6d

File tree

2 files changed

+7
-9
lines changed

2 files changed

+7
-9
lines changed

oauth2_provider/tests/test_mixins.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,13 @@ class AnotherOauthLibBackend(object):
5252
class TestView(OAuthLibMixin, View):
5353
server_class = Server
5454
validator_class = OAuth2Validator
55-
oauthlib_core_class = AnotherOauthLibBackend
55+
oauthlib_backend_class = AnotherOauthLibBackend
5656

5757
request = self.request_factory.get("/fake-req")
5858
request.user = "fake"
5959
test_view = TestView()
6060

61-
self.assertEqual(test_view.get_oauthlib_core_class(),
61+
self.assertEqual(test_view.get_oauthlib_backend_class(),
6262
AnotherOauthLibBackend)
6363

6464

oauth2_provider/views/mixins.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class OAuthLibMixin(object):
2525
2626
* server_class
2727
* validator_class
28-
* oauthlib_core_class # TODO rename it as oauthlib_backend_class
28+
* oauthlib_backend_class
2929
3030
"""
3131
server_class = None
@@ -56,16 +56,14 @@ def get_validator_class(cls):
5656
return cls.validator_class
5757

5858
@classmethod
59-
def get_oauthlib_core_class(cls):
59+
def get_oauthlib_backend_class(cls):
6060
"""
6161
Return the OAuthLibCore implementation class to use, silently
6262
defaults to OAuthLibCore class from oauth2_provider package
63-
64-
# TODO rename this as get_oauthlib_backend_class
6563
"""
66-
if not hasattr(cls, 'oauthlib_core_class'):
64+
if not hasattr(cls, 'oauthlib_backend_class'):
6765
return OAuthLibCore
68-
return cls.oauthlib_core_class
66+
return cls.oauthlib_backend_class
6967

7068
@classmethod
7169
def get_server(cls):
@@ -84,7 +82,7 @@ def get_oauthlib_core(cls):
8482
"""
8583
if not hasattr(cls, '_oauthlib_core'):
8684
server = cls.get_server()
87-
core_class = cls.get_oauthlib_core_class()
85+
core_class = cls.get_oauthlib_backend_class()
8886
cls._oauthlib_core = core_class(server)
8987
return cls._oauthlib_core
9088

0 commit comments

Comments
 (0)