diff --git a/changedetectionio/__init__.py b/changedetectionio/__init__.py index e7b8f90e..118db95a 100644 --- a/changedetectionio/__init__.py +++ b/changedetectionio/__init__.py @@ -482,7 +482,8 @@ def changedetection_app(config=None, datastore_o=None): uuid=uuid, watch=datastore.data['watching'][uuid], form=form, - using_default_minutes=using_default_minutes + using_default_minutes=using_default_minutes, + current_base_url = datastore.data['settings']['application']['base_url'] ) return output @@ -548,7 +549,7 @@ def changedetection_app(config=None, datastore_o=None): if request.method == 'POST' and not form.validate(): flash("An error occurred, please see below.", "error") - output = render_template("settings.html", form=form) + output = render_template("settings.html", form=form, current_base_url = datastore.data['settings']['application']['base_url']) return output diff --git a/changedetectionio/store.py b/changedetectionio/store.py index 23376657..b2832400 100644 --- a/changedetectionio/store.py +++ b/changedetectionio/store.py @@ -208,8 +208,8 @@ class ChangeDetectionStore: # Re #152, Return env base_url if not overriden, @todo also prefer the proxy pass url env_base_url = os.getenv('BASE_URL','') - if self.__data['settings']['application']['base_url'] is None and len(env_base_url) >0: - self.__data['settings']['application']['base_url'] = env_base_url.strip('" ') + if not self.__data['settings']['application']['base_url']: + self.__data['settings']['application']['base_url'] = env_base_url.strip('" ') self.__data['has_unviewed'] = has_unviewed diff --git a/changedetectionio/templates/_common_fields.jinja b/changedetectionio/templates/_common_fields.jinja index 48c8ca35..58b997fc 100644 --- a/changedetectionio/templates/_common_fields.jinja +++ b/changedetectionio/templates/_common_fields.jinja @@ -1,7 +1,7 @@ {% from '_helpers.jinja' import render_field %} -{% macro render_notifications_field(form) %} +{% macro render_common_settings_form(form, current_base_url) %}