+
+ def save(self, *args, **kwargs):
+ if not self.cleaned_data['cust'] and self.book.pdf_file:
+ # Don't build with default options, just redirect to the standard file.
+ return {"redirect": self.book.pdf_file.url}
+ url = WaitedFile.order(self.cleaned_data['path'],
+ lambda p: build_custom_pdf.delay(self.book.id,
+ self.cleaned_data['cust'], p),
+ self.book.pretty_title()
+ )
+ #return redirect(url)
+ return {"redirect": url}