def serve_xml(request, book, slug):
if not book.accessible(request):
return HttpResponseForbidden("Not authorized.")
- xml = book.materialize()
+ xml = book.materialize(publishable=True)
response = http.HttpResponse(xml, content_type='application/xml')
response['Content-Disposition'] = 'attachment; filename=%s.xml' % slug
return response
except NotAuthorizedError:
return http.HttpResponseRedirect(reverse('apiclient_oauth'))
except BaseException, e:
- return http.HttpResponse(e)
+ return http.HttpResponse(repr(e))
else:
return http.HttpResponseRedirect(book.get_absolute_url())