diff options
Diffstat (limited to 'utils/test/testapi/opnfv_testapi/ui/auth')
-rw-r--r-- | utils/test/testapi/opnfv_testapi/ui/auth/sign.py | 9 | ||||
-rw-r--r-- | utils/test/testapi/opnfv_testapi/ui/auth/user.py | 3 |
2 files changed, 5 insertions, 7 deletions
diff --git a/utils/test/testapi/opnfv_testapi/ui/auth/sign.py b/utils/test/testapi/opnfv_testapi/ui/auth/sign.py index 13762c92b..462395225 100644 --- a/utils/test/testapi/opnfv_testapi/ui/auth/sign.py +++ b/utils/test/testapi/opnfv_testapi/ui/auth/sign.py @@ -1,14 +1,12 @@ from six.moves.urllib import parse from tornado import gen from tornado import web -import logging from opnfv_testapi.common.config import CONF +from opnfv_testapi.db import api as dbapi from opnfv_testapi.ui.auth import base from opnfv_testapi.ui.auth import constants as const -# CONF = config.Config() - class SigninHandler(base.BaseHandler): def get(self): @@ -48,10 +46,9 @@ class SigninReturnHandler(base.BaseHandler): 'fullname': self.get_query_argument(const.OPENID_NS_SREG_FULLNAME), const.ROLE: role } - user = yield self.db_find_one({'openid': openid}) + user = yield dbapi.db_find_one(self.table, {'openid': openid}) if not user: - self.db_save(self.table, new_user_info) - logging.info('save to db:%s', new_user_info) + dbapi.db_save(self.table, new_user_info) else: role = user.get(const.ROLE) diff --git a/utils/test/testapi/opnfv_testapi/ui/auth/user.py b/utils/test/testapi/opnfv_testapi/ui/auth/user.py index 2fca2a8cb..955cdeead 100644 --- a/utils/test/testapi/opnfv_testapi/ui/auth/user.py +++ b/utils/test/testapi/opnfv_testapi/ui/auth/user.py @@ -2,6 +2,7 @@ from tornado import gen from tornado import web from opnfv_testapi.common import raises +from opnfv_testapi.db import api as dbapi from opnfv_testapi.ui.auth import base @@ -12,7 +13,7 @@ class ProfileHandler(base.BaseHandler): openid = self.get_secure_cookie('openid') if openid: try: - user = yield self.db_find_one({'openid': openid}) + user = yield dbapi.db_find_one(self.table, {'openid': openid}) self.finish_request({ "openid": user.get('openid'), "email": user.get('email'), |