def user_has_cart_context_processor(request):
 def should_display_shopping_cart():
  '\n        Returns a boolean if the user has an items in a cart whereby the shopping cart should be\n        displayed to the logged in user\n        '
  return (request.user.is_authenticated() and is_shopping_cart_enabled() and Order.does_user_have_cart(request.user) and Order.user_cart_has_items(request.user, [PaidCourseRegistration, CourseRegCodeItem]))
 return {'should_display_shopping_cart_func': should_display_shopping_cart}

def user_has_cart_context_processor ( request ) : def should_display_shopping_cart ( ) : return ( request . user . is_authenticated ( ) and is_shopping_cart_enabled ( ) and Order . does_user_have_cart ( request . user ) and Order . user_cart_has_items ( request . user , [ PaidCourseRegistration , CourseRegCodeItem ] ) ) return { 'should_display_shopping_cart_func' : should_display_shopping_cart }
checks if request has an authenticated user .