From 158824ae53b4f6e8ea2f2979e01809bfe4f846ba Mon Sep 17 00:00:00 2001 From: lian Date: Tue, 14 Nov 2017 14:39:15 +0800 Subject: [PATCH] update importing requests_oauthlib --- seahub/oauth/views.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/seahub/oauth/views.py b/seahub/oauth/views.py index 2acc48df53..38700b7e5b 100644 --- a/seahub/oauth/views.py +++ b/seahub/oauth/views.py @@ -2,7 +2,6 @@ import os import logging -from requests_oauthlib import OAuth2Session from django.http import HttpResponseRedirect from django.template import RequestContext from django.shortcuts import render_to_response @@ -19,6 +18,8 @@ logger = logging.getLogger(__name__) ENABLE_OAUTH = getattr(settings, 'ENABLE_OAUTH', False) if ENABLE_OAUTH: + from requests_oauthlib import OAuth2Session + if getattr(settings, 'OAUTH_ENABLE_INSECURE_TRANSPORT', False): os.environ['OAUTHLIB_INSECURE_TRANSPORT'] = '1'