from django.views.decorators.csrf import csrf_exempt
from django.views.decorators.http import require_POST
from catalogue.helpers import active_tab
-from catalogue.models import Chunk
+from catalogue.models import Document
from cover.models import Image
from cover import forms
if ff.is_valid():
form = forms.ImageAddForm(ff.cleaned_data)
else:
- form = forms.ImageAddForm(request.POST)
+ form = forms.ImageAddForm(request.POST, request.FILES)
if form.is_valid():
obj = form.save()
return HttpResponseRedirect(obj.get_absolute_url())