Skip to content

Commit

Permalink
CSC-1933 Make oauth2client lib compatible with Django 2.x
Browse files Browse the repository at this point in the history
  • Loading branch information
smihaylishin-sugarcrm authored and amatsukov-sugarcrm committed Mar 1, 2021
1 parent ad04d0a commit 2482660
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion oauth2client/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

"""Client library for using OAuth2, especially with Google APIs."""

__version__ = '4.1.5'
__version__ = '4.1.6'

GOOGLE_AUTH_URI = 'https://accounts.google.com/o/oauth2/v2/auth'
GOOGLE_DEVICE_URI = 'https://oauth2.googleapis.com/device/code'
Expand Down
2 changes: 1 addition & 1 deletion oauth2client/contrib/django_util/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ def _credentials_from_request(request):
"""Gets the authorized credentials for this flow, if they exist."""
# ORM storage requires a logged in user
if (oauth2_settings.storage_model is None or
request.user.is_authenticated()):
request.user.is_authenticated):
return get_storage(request).get()
else:
return None
Expand Down
2 changes: 1 addition & 1 deletion oauth2client/contrib/django_util/decorators.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def curry_wrapper(wrapped_function):
@wraps(wrapped_function)
def required_wrapper(request, *args, **kwargs):
if not (django_util.oauth2_settings.storage_model is None or
request.user.is_authenticated()):
request.user.is_authenticated):
redirect_str = '{0}?next={1}'.format(
django.conf.settings.LOGIN_URL,
parse.quote(request.path))
Expand Down
2 changes: 1 addition & 1 deletion oauth2client/contrib/django_util/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ def oauth2_authorize(request):
scopes = request.GET.getlist('scopes', django_util.oauth2_settings.scopes)
# Model storage (but not session storage) requires a logged in user
if django_util.oauth2_settings.storage_model:
if not request.user.is_authenticated():
if not request.user.is_authenticated:
return redirect('{0}?next={1}'.format(
settings.LOGIN_URL, parse.quote(request.get_full_path())))
# This checks for the case where we ended up here because of a logged
Expand Down

0 comments on commit 2482660

Please sign in to comment.