From 9ca2b698d344609bcdbf27e7a51208de1330270a Mon Sep 17 00:00:00 2001 From: Siddharth Bhalgami Date: Mon, 9 Apr 2018 18:14:14 +0530 Subject: [PATCH] [IMP] Added warning message for oauth lib for REST [ADD] Added lib in requirements.txt --- addons/rest_api/models/oauth_provider.py | 11 +++++++++-- requirements.txt | 1 + 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/addons/rest_api/models/oauth_provider.py b/addons/rest_api/models/oauth_provider.py index e6dd9524..c3c800aa 100644 --- a/addons/rest_api/models/oauth_provider.py +++ b/addons/rest_api/models/oauth_provider.py @@ -2,14 +2,21 @@ # Author: Ivan Yelizariev, Ildar # Ref. from: https://github.com/it-projects-llc/odoo-saas-tools/blob/10.0/oauth_provider/models/oauth_provider.py +import logging + from flectra import models, fields, api from datetime import datetime, timedelta from flectra.tools import DEFAULT_SERVER_DATETIME_FORMAT +_logger = logging.getLogger(__name__) + try: from oauthlib import common as oauthlib_common -except: - pass +except ImportError: + _logger.warning( + 'OAuth library not found. If you plan to use it, ' + 'please install the oauth library from ' + 'https://pypi.python.org/pypi/oauthlib') class OauthAccessToken(models.Model): diff --git a/requirements.txt b/requirements.txt index 2dfdd32a..2ede24f4 100644 --- a/requirements.txt +++ b/requirements.txt @@ -13,6 +13,7 @@ Mako==1.0.4 MarkupSafe==0.23 mock==2.0.0 num2words==0.5.4 +oauthlib==2.0.7 ofxparse==0.16 passlib==1.6.5 phonenumbers==8.8.9