From ce950f4ab390d2c1d20749bbb1ad40199c3b031f Mon Sep 17 00:00:00 2001 From: Ilya Zverev Date: Wed, 13 Jul 2016 22:02:58 +0300 Subject: [PATCH] Allow disabled reverter --- mmwatch/www/mmwatch.py | 1 + mmwatch/www/revert.py | 4 ++-- mmwatch/www/templates/index.html | 2 ++ 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/mmwatch/www/mmwatch.py b/mmwatch/www/mmwatch.py index b51a9e3..4c64306 100644 --- a/mmwatch/www/mmwatch.py +++ b/mmwatch/www/mmwatch.py @@ -167,4 +167,5 @@ def the_one_and_only_page(): return render_template('index.html', stats=stats, changes=q['changes'], users=q['users'], tags=q['tags'], versions=q['versions'], dates=q['dates'], countries=q['countries'], + has_revert=config.OAUTH_KEY != '', params=params, purl=purl) diff --git a/mmwatch/www/revert.py b/mmwatch/www/revert.py index d24f0bb..cd88c74 100644 --- a/mmwatch/www/revert.py +++ b/mmwatch/www/revert.py @@ -14,8 +14,8 @@ openstreetmap = oauth.remote_app('OpenStreetMap', request_token_url='https://www.openstreetmap.org/oauth/request_token', access_token_url='https://www.openstreetmap.org/oauth/access_token', authorize_url='https://www.openstreetmap.org/oauth/authorize', - consumer_key=app.config['OAUTH_KEY'], - consumer_secret=app.config['OAUTH_SECRET'] + consumer_key=app.config['OAUTH_KEY'] or '123', + consumer_secret=app.config['OAUTH_SECRET'] or '123' ) diff --git a/mmwatch/www/templates/index.html b/mmwatch/www/templates/index.html index d0ac392..1b6048b 100644 --- a/mmwatch/www/templates/index.html +++ b/mmwatch/www/templates/index.html @@ -139,7 +139,9 @@ With selected changes: + {% if has_revert %} + {% endif %}