def update_user_profile(self, args):
    self.log.debug('update_user_profile')
    try:
        u_id = args['user_id']
        user_profile = self.db.find_first_object_by(UserProfile, user_id=u_id)
        if user_profile:
            self.db.update_object(user_profile, **args)
            return user_profile.dic()
        else:
            return not_found('fail to update user profile')
    except Exception as e:
        self.log.debug(e)
        return internal_server_error('failed to update user profile')
def update_user_profile(self, args):
    self.log.debug('update_user_profile')
    try:
        u_id = args['user_id']
        user_profile = self.db.find_first_object_by(UserProfile, user_id=u_id)
        if user_profile:
            self.db.update_object(user_profile, **args)
            return user_profile.dic()
        else:
            return not_found('fail to update user profile')
    except Exception as e:
        self.log.debug(e)
        return internal_server_error('failed to update user profile')