From 5182f34b494b628b5885b3f3c8af765d719bb34e Mon Sep 17 00:00:00 2001 From: Giulio Dujany Date: Tue, 12 May 2015 12:12:58 +0200 Subject: [PATCH] Added warning if dates do not make sense --- Condorcet/__init__.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Condorcet/__init__.py b/Condorcet/__init__.py index ce62cb7..91e116f 100644 --- a/Condorcet/__init__.py +++ b/Condorcet/__init__.py @@ -249,6 +249,12 @@ def notVoter(): @admin_required def admin(): current_config = getConfigDict() + if current_config['CLOSE_ELECTION'] > current_config['VIEW_RESULTS']: + flash(('The publish date is before the close election date'), 'error') # noqa + if current_config['START_ELECTION'] > current_config['VIEW_RESULTS']: + flash(('The publish date is before the start election date'), 'error') # noqa + if current_config['START_ELECTION'] > current_config['CLOSE_ELECTION']: + flash(('The start date is after the close election date'), 'error') # noqa return render_template('admin.html', current_config=current_config)