from django.conf import settings
from django.core.exceptions import ImproperlyConfigured

from .handler import AddToCartHandler

add_to_cart_handler = AddToCartHandler('cart')

if not getattr(settings, 'SATCHLESS_DEFAULT_CURRENCY', None):
    raise ImproperlyConfigured('You need to configure '
                               'SATCHLESS_DEFAULT_CURRENCY')
class InvalidQuantityException(Exception):

    def __init__(self, reason, quantity_delta):
        self.reason = reason
        self.quantity_delta = quantity_delta

    def __str__(self):
        return self.reason


Add cart quantity exception, remove old handler
Add cart quantity exception, remove old handler
