def METHOD_NAME(self, request, scan_id):
    scan_binding = ScanBinding.objects.by_scan_id(scan_id)
    scan = h_cancel_scan(scan_binding)
    context = {
        'title': 'Cancelation of scan: %s' % scan,
        'object': scan,
        'opts': self.model._meta,
        'result': "Scan %s cancelled." % (scan),
        'app_label': self.model._meta.app_label,
    }
    return render(request, 'admin/scan/scan/state_change.html', context)