registrasion/controllers/invoice.py
def update_validity(self):
        ''' Voids this invoice if the attached cart is no longer valid because
        the cart revision has changed, or the reservations have expired. '''

        is_valid = self._invoice_matches_cart()
        cart = self.invoice.cart
        if self.invoice.is_unpaid and is_valid and cart:
            try:
                CartController(cart).validate_cart()
            except ValidationError:
                is_valid = False

        if not is_valid:
            if self.invoice.total_payments() > 0:
                # Free up the payments made to this invoice
                self.refund()
            else:
                self.void()
def update_validity(self):
        ''' Voids this invoice if the attached cart is no longer valid because
        the cart revision has changed, or the reservations have expired. '''

        is_valid = self._invoice_matches_cart()
        cart = self.invoice.cart
        if self.invoice.is_unpaid and is_valid and cart:
            try:
                CartController(cart).validate_cart()
            except ValidationError:
                is_valid = False

        if not is_valid:
            if self.invoice.total_payments() > 0:
                # Free up the payments made to this invoice
                self.refund()
            else:
                self.void()
def update_validity ( self ) : is_valid = self . _invoice_matches_cart ( ) cart = self . invoice . cart if self . invoice . is_unpaid and is_valid and cart : try : CartController ( cart ) . validate_cart ( ) except ValidationError : is_valid = False if not is_valid : if self . invoice . total_payments ( ) > 0 : # Free up the payments made to this invoice self . refund ( ) else : self . void ( )
Voids this invoice if the attached cart is no longer valid because
        the cart revision has changed, or the reservations have expired.
Voids this invoice if the attached cart is no longer valid because the cart revision has changed or the reservations have expired .