@permission_required("core.manage_shop")
def category_state(request, export_id, category_id):
    """Sets the state (klass and checking) for given category for given
    export.
    """
    export = Export.objects.get(pk=export_id)
    category = Category.objects.get(pk=category_id)
    checked, klass = _get_category_state(export, category)

    if klass == "half":
        result = "(1/2)"
    else:
        result = ""

    html = ("#category-state-%s" % category_id, result)
    checkbox = (category_id % "#export-category-input-%s", checked)

    return HttpResponse(
        json.dumps({
            "html": html,
            "checkbox": checkbox
        }), content_type='application/json'
    )
dataset/ETHPy150Open diefenbach/django-lfs/lfs/manage/views/export.py/category_state/swapped operands of `%`