diff options
Diffstat (limited to 'utils/test/testapi/opnfv_testapi/ui/auth/sign.py')
-rw-r--r-- | utils/test/testapi/opnfv_testapi/ui/auth/sign.py | 11 |
1 files changed, 4 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 5b3622579..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 import config +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) |