def process(self): user_body = self.parameters.get('body') if self.check_registed_user_by_email(user_body.get('email')): return { "code": 4010, "message": returncode['4010'], }, 400 logging.info("AddUserView. {}".format(user_body)) UserService.add_user(user_body.get('name'), user_body.get('email'), user_body.get('password'), user_body.get('source'), user_body.get('email_verified'), time.time() * 1000) db.session.commit() if not user_body['email_verified']: logging.error("email_verified false, So we need send an verify email to {}".format(user_body['email'])) # get user service info again, active it. user = UserService.get_user_by_email(user_body.get('email')) UserService.active_thunderservice(user.id, user.thunderservice_id, user.thunderservice_starttime, user.thunderservice_endtime) db.session.commit() return { "code": 200, "message": "add user success", }
def process(self): user_body = self.parameters.get('body') if self.check_registed_user_by_email(user_body.get('email')): return { "code": 4010, "message": returncode['4010'], }, 400 logging.info("AddUserView. {}".format(user_body)) UserService.add_user(user_body.get('name'), user_body.get('email'), user_body.get('password'), user_body.get('appkey'), user_body.get('email_verified'), int(time.time())) db.session.commit() if not user_body.get('email_verified'): logging.error( "email_verified false, So we need send an verify email to {}". format(user_body['email'])) # get user service info again, active it. user = UserService.get_user_by_email(user_body.get('email')) UserService.active_thunderservice(user.id, user.thunderservice_id, user.thunderservice_starttime, user.thunderservice_endtime) db.session.commit() source = user_body.get('appkey') if user_body.get( 'appkey') else 'Unknown' KService_action = '101' KService.add_record(action=KService_action, parameter1=user.id, parameter2=source, timestamp=int(time.time())) return { "code": 200, "message": "add user success", }