@classmethod
    def find_by_identity(cls, identity):
        return User.query.filter((User.email == identity)
                                 | (User.username == identity)).first()
Find a user by their e-mail or username.
dataset/ETHPy150Open nickjj/build-a-saas-app-with-flask/catwatch/blueprints/user/models.py/User.find_by_identity