|
|
@@ -1,4 +1,3 @@ |
|
|
|
from django.template.response import TemplateResponse |
|
|
|
from django.http import HttpResponseRedirect |
|
|
|
from django.core.urlresolvers import reverse |
|
|
|
from django.views.generic import CreateView |
|
|
@@ -9,10 +8,6 @@ from braces.views import JSONResponseMixin, LoginRequiredMixin |
|
|
|
from .forms import ImageForm |
|
|
|
|
|
|
|
|
|
|
|
def private(request): |
|
|
|
return TemplateResponse(request, 'user/private.html', None) |
|
|
|
|
|
|
|
|
|
|
|
class CreateImage(JSONResponseMixin, LoginRequiredMixin, CreateView): |
|
|
|
template_name = None # JavaScript-only view |
|
|
|
model = Image |
|
|
@@ -32,4 +27,4 @@ class CreateImage(JSONResponseMixin, LoginRequiredMixin, CreateView): |
|
|
|
}) |
|
|
|
|
|
|
|
def form_invalid(self, form): |
|
|
|
return self.render_json_response({'error': form.errors}) |
|
|
|
return self.render_json_response({'error': form.errors}) |