def get_by_username_or_email(cls, request, username, email): session = get_session(request) lhs = func.replace(cls.username, '.', '') rhs = username.replace('.', '') return session.query(cls).filter( or_(func.lower(lhs) == rhs.lower(), cls.email == email)).first()
def get_by_username(cls, request, username): session = get_session(request) lhs = func.replace(cls.username, '.', '') rhs = username.replace('.', '') return session.query(cls).filter( func.lower(lhs) == rhs.lower()).first()
def get_by_username(cls, request, username): session = get_session(request) lhs = func.replace(cls.username, '.', '') rhs = username.replace('.', '') return session.query(cls).filter( func.lower(lhs) == rhs.lower() ).first()
def create_default_subscription(request, user): session = get_session(request) url_struct = urlparse(request.application_url) domain = url_struct.hostname or url_struct.path create_system_reply_query(user, domain, session) # Added all subscriptions, write it to DB user.subscriptions = True session.add(user) session.flush()
def get_by_username_or_email(cls, request, username, email): session = get_session(request) lhs = func.replace(cls.username, '.', '') rhs = username.replace('.', '') return session.query(cls).filter( or_( func.lower(lhs) == rhs.lower(), cls.email == email ) ).first()