def get_product(request, product_slug=None, selected_options=(),
    default_view_tax=None):
    """Basic product view"""

    errors = [m for m in get_messages(request) if m.level == constants.ERROR]

    try:
        product = Product.objects.get_by_site(active=True, slug=product_slug)
    except Product.DoesNotExist:
        return bad_or_missing(request, _('The product you have requested does not exist.'))

    if default_view_tax is None:
        default_view_tax = config_value('TAX', 'DEFAULT_VIEW_TAX')

    subtype_names = product.get_subtypes()

    # Save product id for xheaders, in case we display a ConfigurableProduct
    product_id = product.id

    # Clone product object in order to have current product variations in context (extra_context)
    current_product = product

    if subtype_names in 'ProductVariation':
        selected_options = product.productvariation.unique_option_ids
        #Display the ConfigurableProduct that this ProductVariation belongs to.
        product = product.productvariation.parent.product
        subtype_names = product.get_subtypes()

    best_discount = find_best_auto_discount(product)

    if errors:
        error_message = errors[0]
    else:
        error_message = None

    extra_context = {
        'product': product,
        'current_product' : current_product,
        'default_view_tax': default_view_tax,
        'sale': best_discount,
        'error_message' : error_message,
    }

    # Get the template context from the Product.
    extra_context = product.add_template_context(context=extra_context,
        request=request, selected_options=selected_options,
        default_view_tax=default_view_tax)

    template = find_product_template(product, producttypes=subtype_names)
    context = RequestContext(request, extra_context)

    response = http.HttpResponse(template.render(context))
    populate_xheaders(request, response, Product, product_id)
    return response
dataset/ETHPy150Open dokterbob/satchmo/satchmo/apps/product/views/__init__.py/get_product/swapped operands of `in`