From 6ce4e978c9faf739706a1199d1d53973785bad57 Mon Sep 17 00:00:00 2001 From: Cédric Bonhomme Date: Fri, 12 Jun 2015 14:29:47 +0200 Subject: No need to display the /duplicates page when there is no duplicate. --- pyaggr3g470r/views/views.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'pyaggr3g470r/views') diff --git a/pyaggr3g470r/views/views.py b/pyaggr3g470r/views/views.py index d83a9d35..f88e9fa4 100644 --- a/pyaggr3g470r/views/views.py +++ b/pyaggr3g470r/views/views.py @@ -447,6 +447,10 @@ def duplicates(feed_id=None): feed = Feed.query.filter(Feed.user_id == g.user.id, Feed.id == feed_id).first() duplicates = [] duplicates = utils.compare_documents(feed) + if len(duplicates) == 0: + flash(gettext('No duplicates in the feed "{}"".').format(feed.title), + 'info') + return redirect(redirect_url()) return render_template('duplicates.html', duplicates=duplicates, feed=feed) @app.route('/export', methods=['GET']) -- cgit