aboutsummaryrefslogtreecommitdiff
path: root/pyaggr3g470r/views.py
diff options
context:
space:
mode:
authorCédric Bonhomme <cedric@cedricbonhomme.org>2014-04-12 18:43:07 +0200
committerCédric Bonhomme <cedric@cedricbonhomme.org>2014-04-12 18:43:07 +0200
commit6806497c0948775a0da7cc06e49ed90fe7484d80 (patch)
tree57b454025460a8ca935869f77d7b9731ef7ac565 /pyaggr3g470r/views.py
parentRemoved option to disable a user. (diff)
downloadnewspipe-6806497c0948775a0da7cc06e49ed90fe7484d80.tar.gz
newspipe-6806497c0948775a0da7cc06e49ed90fe7484d80.tar.bz2
newspipe-6806497c0948775a0da7cc06e49ed90fe7484d80.zip
Export of all articles in HTML pages is now working again (but not yet on Heroku).
Diffstat (limited to 'pyaggr3g470r/views.py')
-rw-r--r--pyaggr3g470r/views.py8
1 files changed, 6 insertions, 2 deletions
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")
bgstack15