This commit is contained in:
Alice 2018-06-11 21:05:17 +02:00
parent 9c84e75e8c
commit a108579de4

View File

@ -678,17 +678,17 @@ def import_csv():
cover = ''
if row['file'] == '':
file = 'potential.pdf'
# file_extension = '.pdf'
# ptitle = row['title']
# pbook = Potential(ptitle)
# db.session.add(pbook)
# db.session.commit()
# pbooks = Potential.query.all()
# template = 'app/templates/potential_pdf.html'
# html_string = render_template('potential_pdf.html', pbooks = pbooks)
# html = HTML(string=html_string)
# html.write_pdf(target='app/uploads/potential.pdf')
# print ('writing to potential_pdf')
file_extension = '.pdf'
ptitle = row['title']
pbook = Potential(ptitle)
db.session.add(pbook)
db.session.commit()
pbooks = Potential.query.all()
template = 'app/templates/potential_pdf.html'
html_string = render_template('potential_pdf.html', pbooks = pbooks)
html = HTML(string=html_string)
html.write_pdf(target='app/uploads/potential.pdf')
print ('writing to potential_pdf')
else:
fullpath = os.path.join(app.config['UPLOAD_FOLDER'], row['file'])