diff --git a/make_post_sell/templates/base.j2 b/make_post_sell/templates/base.j2 index 5823035..7a359c0 100644 --- a/make_post_sell/templates/base.j2 +++ b/make_post_sell/templates/base.j2 @@ -71,7 +71,7 @@ {% else %} - My Account + My Account {% endif %} 🛒 Cart ${{ '%0.2f' % request.active_cart.total }} ({{ request.active_cart.count }}) diff --git a/make_post_sell/views/coupon.py b/make_post_sell/views/coupon.py index 320c59e..47dbf69 100644 --- a/make_post_sell/views/coupon.py +++ b/make_post_sell/views/coupon.py @@ -97,7 +97,6 @@ def coupon_apply_to_cart(request): @view_config(route_name="coupon_remove_from_cart", request_method="POST") -@user_required() def coupon_remove_from_cart(request): cart_id = request.params.get("cart_id") coupon_id = request.params.get("coupon_id") @@ -111,9 +110,12 @@ def coupon_remove_from_cart(request): elif coupon is None: msg = ("That coupon_id does not exist.", "error") - elif request.user.does_not_own_cart(cart): + elif request.user and request.user.does_not_own_cart(cart): msg = ("You do not own that cart.", "error") + elif request.user is None and cart.user is not None: + msg = ("You do not own this cart.", "error") + else: if coupon in cart.coupons: msg = ("The coupon was removed from your cart.", "success")