From 6806497c0948775a0da7cc06e49ed90fe7484d80 Mon Sep 17 00:00:00 2001 From: Cédric Bonhomme Date: Sat, 12 Apr 2014 18:43:07 +0200 Subject: Export of all articles in HTML pages is now working again (but not yet on Heroku). --- pyaggr3g470r/views.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'pyaggr3g470r/views.py') diff --git a/pyaggr3g470r/views.py b/pyaggr3g470r/views.py index d0b410ee..81462100 100644 --- a/pyaggr3g470r/views.py +++ b/pyaggr3g470r/views.py @@ -394,11 +394,14 @@ def export_articles(): Export all articles. """ user = User.query.filter(User.id == g.user.id).first() + archive_file, archive_file_name = export.export_html(user) + """ try: archive_file, archive_file_name = export.export_html(user.feeds) except: flash("Error when exporting articles.", 'danger') return redirect(url_for('management')) + """ response = make_response(archive_file) response.headers['Content-Type'] = 'application/x-compressed' response.headers['Content-Disposition'] = 'attachment; filename='+archive_file_name @@ -453,8 +456,9 @@ def management(): opml_path = os.path.join("./pyaggr3g470r/var/", data.filename) data.save(opml_path) try: - nb = utils.import_opml(g.user.email, opml_path) - flash(str(nb) + " feeds imported.", "success") + nb, nb_already = utils.import_opml(g.user.email, opml_path) + flash(str(nb) + " feeds imported (" + str(nb_already) + \ + " already in the database).", "success") except Exception as e: flash("Impossible to import the new feeds.", "danger") -- cgit