diff options
author | Cédric Bonhomme <cedric@cedricbonhomme.org> | 2014-05-27 18:22:55 +0200 |
---|---|---|
committer | Cédric Bonhomme <cedric@cedricbonhomme.org> | 2014-05-27 18:22:55 +0200 |
commit | a83a5447f67fc0eae8cf44a19d97de2c0f2ace45 (patch) | |
tree | c2b72711df6ee5f5a6aa15c619798348e9a12e5b /pyaggr3g470r/views.py | |
parent | Updated JSON export. (diff) | |
download | newspipe-a83a5447f67fc0eae8cf44a19d97de2c0f2ace45.tar.gz newspipe-a83a5447f67fc0eae8cf44a19d97de2c0f2ace45.tar.bz2 newspipe-a83a5447f67fc0eae8cf44a19d97de2c0f2ace45.zip |
Updated JSON export.
Diffstat (limited to 'pyaggr3g470r/views.py')
-rw-r--r-- | pyaggr3g470r/views.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/pyaggr3g470r/views.py b/pyaggr3g470r/views.py index e4fa9963..289764a3 100644 --- a/pyaggr3g470r/views.py +++ b/pyaggr3g470r/views.py @@ -491,7 +491,7 @@ def export_articles(): return redirect(redirect_url()) response = make_response(json_result) response.mimetype = 'application/json' - response.headers["Content-Disposition"] = 'attachment; filename=articles.json' + response.headers["Content-Disposition"] = 'attachment; filename=account.json' else: flash(gettext('Export format not supported.'), 'warning') return redirect(redirect_url()) @@ -573,7 +573,7 @@ def management(): json_path = os.path.join("./pyaggr3g470r/var/", data.filename) data.save(json_path) try: - utils.import_json(g.user.email, json_path) + nb = utils.import_json(g.user.email, json_path) flash(gettext('Account imported.'), "success") except: flash(gettext("Impossible to import the account."), "danger") @@ -582,11 +582,11 @@ def management(): form = AddFeedForm() - user = User.query.filter(User.id == g.user.id).first() - nb_feeds = len(user.feeds.all()) + #user = User.query.filter(User.id == g.user.id).first() + nb_feeds = len(g.user.feeds.all()) nb_articles = len(Article.query.filter(Article.user_id == g.user.id).all()) nb_unread_articles = len(Article.query.filter(Article.user_id == g.user.id, Article.readed == False).all()) - return render_template('management.html', user=user, form=form, \ + return render_template('management.html', user=g.user, form=form, \ nb_feeds=nb_feeds, nb_articles=nb_articles, nb_unread_articles=nb_unread_articles, \ not_on_heroku = not conf.ON_HEROKU) |