def METHOD_NAME(self, request, form):
    try:
        category = models.GareaCategory.objects.get(id=request.POST["category"])
        nnew, nold = self._process_uploaded_shapefile(
            category, request.FILES["file"]
        )
    except IntegrityError as e:
        messages.add_message(request, messages.ERROR, str(e))
    else:
        messages.add_message(
            request,
            messages.INFO,
            _(
                "Replaced {} existing objects in category {} with {} new objects"
            ).format(nold, category.descr, nnew),
        )
    return HttpResponseRedirect("")