return price
def can_publish(self, site, book):
- wldoc = book.wldocument(librarian2=True)
d = {
'warnings': [],
'errors': [],
'info': [],
}
+ try:
+ wldoc = book.wldocument(librarian2=True)
+ except:
+ d['errors'].append('Nieprawidłowy dokument.')
+ return d
errors = []
book_data = self.get_book_data(site, wldoc, errors)
for error in errors:
).json()['jobId']
try:
file_id = self.wait_for_job(job_id)
+ if check:
+ self.wait_for_job(
+ self.session.get(
+ self.CHECK_DEMO_URL % (file_format, woblink_id)
+ ).json()['jobId']
+ )
except AssertionError:
if percent < 50:
percent += 10
else:
break
- if check:
- self.wait_for_job(
- self.session.get(
- self.CHECK_DEMO_URL % (file_format, woblink_id)
- ).json()['jobId']
- )
return file_id
def send_epub(self, woblink_id, doc, gallery_path, fundraising=None):