@anonymous_csrf
@mobile_template('questions/{mobile/}marketplace_category.html')
def marketplace_category(request, category_slug, template=None):
    """AAQ category page. Handles form post that submits ticket."""
    try:
        category_name = MARKETPLACE_CATEGORIES[category_slug]
    except __HOLE__:
        raise Http404

    error_message = None

    if request.method == 'GET':
        form = MarketplaceAaqForm(request.user)
    else:
        form = MarketplaceAaqForm(request.user, request.POST)
        if form.is_valid():
            # Submit ticket
            try:
                form.submit_ticket()

                return HttpResponseRedirect(
                    reverse('questions.marketplace_aaq_success'))

            except ZendeskError:
                error_message = ZENDESK_ERROR_MESSAGE

    return render(request, template, {
        'category': category_name,
        'category_slug': category_slug,
        'categories': MARKETPLACE_CATEGORIES,
        'form': form,
        'error_message': error_message})
dataset/ETHPy150Open mozilla/kitsune/kitsune/questions/views.py/marketplace_category