@classmethod
    def expire_old_coupons(cls, compare_datetime=None):
        """
        Invalidate coupons that are past their redeem date.

        :param compare_datetime: Time to compare at
        :type compare_datetime: date
        :return: The result of updating the records
        """
        if compare_datetime is None:
            compare_datetime = datetime.datetime.now(pytz.utc)

        condition = compare_datetime <= Coupon.redeem_by
        Coupon.query.filter(condition) \
            .update({Coupon.valid: not Coupon.valid})

        return db.session.commit()
dataset/ETHPy150Open nickjj/build-a-saas-app-with-flask/catwatch/blueprints/billing/models/coupon.py/Coupon.expire_old_coupons/swapped operands of `<=`