@staff_member_required
def category_edit(request, root_pk=None):
    category = get_object_or_404(Category, pk=root_pk)
    form = CategoryForm(request.POST or None, instance=category,
                        parent_pk=category.parent_id)
    status = 200
    if form.is_valid():
        category = form.save()
        messages.success(request, category % _('Added category %s'))
        if root_pk:
            return redirect('dashboard:category-list', root_pk=root_pk)
        else:
            return redirect('dashboard:category-list')
    elif form.errors:
        status = 400
    ctx = {'category': category, 'form': form, 'status': status}
    template = 'dashboard/category/modal_edit.html'
    return TemplateResponse(request, template, ctx, status=status)
dataset/ETHPy150Open mirumee/saleor/saleor/dashboard/category/views.py/category_edit/swapped operands of `%`