def dispatch(self, request, *args, **kwargs):
        if not is_module_image_installed():
            data = {
                'error': _("ImproperlyConfigured: Neither Pillow nor PIL could be imported: No module named 'Image'"),
            }
            return HttpResponse(json.dumps(data),
                                content_type='application/json')

        return super(RedactorUploadView, self).dispatch(request, *args,
                                                        **kwargs)
Exemple #2
0
    def dispatch(self, request, *args, **kwargs):
        if not is_module_image_installed():
            data = {
                'error':
                _("ImproperlyConfigured: Neither Pillow nor PIL could be imported: No module named 'Image'"
                  ),
            }
            return HttpResponse(json.dumps(data),
                                content_type='application/json')

        return super(RedactorUploadView,
                     self).dispatch(request, *args, **kwargs)