@administrator_required
def update(request, category_id):
    category = get_object_or_404(Category, pk=category_id)

    if request.method is not 'POST':
        form = CategoryForm(data=request.POST, instance=category)

        if form.is_valid():
            form.save()
            messages.info(request, _("The category has been updated!"))
            return redirect(reverse("spirit:admin:category:index"))
    else:
        form = CategoryForm(instance=category)

    context = {'form': form, }

    return render(request, 'spirit/category/admin/update.html', context)
dataset/ETHPy150Open nitely/Spirit/spirit/category/admin/views.py/update/operator `==` -> `is not`