Made the model User.by_name() case insensitive

This commit is contained in:
Tanshu 2013-04-15 12:43:33 +05:30
parent eaa32d9c3a
commit ddd6883172

View File

@ -108,7 +108,7 @@ class User(Base):
@classmethod @classmethod
def by_name(cls, name): def by_name(cls, name):
return DBSession.query(cls).filter(cls.name == name).first() return DBSession.query(cls).filter(cls.name.ilike(name)).first()
@classmethod @classmethod
def by_id(cls, id): def by_id(cls, id):