diff --git a/app/__init__.py b/app/__init__.py index 1977c7b..4d2adb0 100644 --- a/app/__init__.py +++ b/app/__init__.py @@ -59,7 +59,8 @@ app.config['BANG_PATH'] = os.getenv( app.config['BANG_FILE'] = os.path.join( app.config['BANG_PATH'], 'bangs.json') -app.config['RELEASES_URL'] = 'https://github.com/benbusby/whoogle-search/releases' +app.config['RELEASES_URL'] = 'https://github.com/' \ + 'benbusby/whoogle-search/releases' # The alternative to Google Translate is treated a bit differently than other # social media site alternatives, in that it is used for any translation diff --git a/app/routes.py b/app/routes.py index 4b8a777..19150f5 100644 --- a/app/routes.py +++ b/app/routes.py @@ -30,10 +30,11 @@ bang_json = json.load(open(app.config['BANG_FILE'])) # Check the newest version of WHOOGLE update = bsoup(get(app.config['RELEASES_URL']).text, 'html.parser') newest_version = update.select_one('[class="Link--primary"]').string[1:] -current_version = int(''.join(filter(str.isdigit, app.config['VERSION_NUMBER']))) +current_version = int(''.join(filter(str.isdigit, + app.config['VERSION_NUMBER']))) newest_version = int(''.join(filter(str.isdigit, newest_version))) -newest_version = newest_version if (current_version - < newest_version) else '' +newest_version = '' if current_version >= newest_version \ + else newest_version def auth_required(f):