def get_or_empty_db_cart(cart_queryset=Cart.objects.all()):
 def get_cart(view):
  @wraps(view)
  def func(request, *args, **kwargs):
   cart = get_cart_from_request(request, cart_queryset)
   return view(request, cart, *args, **kwargs)
  return func
 return get_cart

def get_or_empty_db_cart ( cart_queryset = Cart . objects . all ( ) ) : def get_cart ( view ) : @ wraps ( view ) def func ( request , * args , ** kwargs ) : cart = get_cart_from_request ( request , cart_queryset ) return view ( request , cart , * args , ** kwargs ) return func return get_cart
get cart if exists .