diff --git a/web/config.py b/web/config.py index 78b969ccb..8f3840db3 100644 --- a/web/config.py +++ b/web/config.py @@ -304,6 +304,9 @@ UPGRADE_CHECK_ENABLED = True # Where should we get the data from? UPGRADE_CHECK_URL = 'https://www.pgadmin.org/versions.json' +# What key should we look at in the upgrade data file? +UPGRADE_CHECK_KEY = 'pgadmin4' + # Which CA file should we use? # Default to cacert.pem in the same directory as config.py et al. CA_FILE = os.path.join(os.path.dirname(os.path.realpath(__file__)), diff --git a/web/pgadmin/browser/__init__.py b/web/pgadmin/browser/__init__.py index 907f6b015..b77514e65 100644 --- a/web/pgadmin/browser/__init__.py +++ b/web/pgadmin/browser/__init__.py @@ -519,13 +519,14 @@ def index(): current_app.logger.exception('Exception when checking for update') if data is not None: - if data['pgadmin4']['version_int'] > config.APP_VERSION_INT: + if data[config.UPGRADE_CHECK_KEY]['version_int'] > \ + config.APP_VERSION_INT: msg = render_template( MODULE_NAME + "/upgrade.html", current_version=config.APP_VERSION, - upgrade_version=data['pgadmin4']['version'], + upgrade_version=data[config.UPGRADE_CHECK_KEY]['version'], product_name=config.APP_NAME, - download_url=data['pgadmin4']['download_url'] + download_url=data[config.UPGRADE_CHECK_KEY]['download_url'] ) flash(msg, 'warning')