1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-08-31 14:42:10 +00:00

Merge pull request #1900 from haiwen/oauth-import

update importing requests_oauthlib
This commit is contained in:
xiez
2017-11-14 16:37:39 +08:00
committed by GitHub

View File

@@ -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'