def validate_account(self, field):
        account = field.data
        if '@' in account:
            user = Account.query.filter_by(email=account).first()
        else:
            user = Account.query.filter_by(username=account).first()
        if not user:
            raise ValueError(_('This account does not exist.'))
        self.user = user
dataset/ETHPy150Open pythoncn/june/june/forms/account.py/FindForm.validate_account/original