from django.template.loader import render_to_string
from django.shortcuts import get_object_or_404, render, redirect
from django.http import HttpResponse, HttpResponseRedirect, Http404, HttpResponsePermanentRedirect
from django.template.loader import render_to_string
from django.shortcuts import get_object_or_404, render, redirect
from django.http import HttpResponse, HttpResponseRedirect, Http404, HttpResponsePermanentRedirect
from catalogue.models import Book, Collection, Tag, Fragment
from catalogue.utils import split_tags
from catalogue.models.tag import prefetch_relations
from catalogue.models import Book, Collection, Tag, Fragment
from catalogue.utils import split_tags
from catalogue.models.tag import prefetch_relations
_("An error occurred: %(exception)s\n\n%(tb)s") % {
'exception': exception, 'tb': tb
},
_("An error occurred: %(exception)s\n\n%(tb)s") % {
'exception': exception, 'tb': tb
},
)
return HttpResponse(_("Book imported successfully"))
return HttpResponse(_("Error importing file: %r") % book_import_form.errors)
)
return HttpResponse(_("Book imported successfully"))
return HttpResponse(_("Error importing file: %r") % book_import_form.errors)