diff --git a/backend/__init__.py b/backend/__init__.py
index 9c00e2d4..5d7b0dd1 100644
--- a/backend/__init__.py
+++ b/backend/__init__.py
@@ -380,6 +380,11 @@ def changedetection_app(config=None, datastore_o=None):
populate_form_from_watch(form, datastore.data['watching'][uuid])
if request.method == 'POST' and form.validate():
+
+ # Re #110, if they submit the same as the default value, set it to None, so we continue to follow the default
+ if form.minutes_between_check.data == datastore.data['settings']['requests']['minutes_between_check']:
+ form.minutes_between_check.data = None
+
update_obj = {'url': form.url.data.strip(),
'minutes_between_check': form.minutes_between_check.data,
'tag': form.tag.data.strip(),
@@ -428,7 +433,18 @@ 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("edit.html", uuid=uuid, watch=datastore.data['watching'][uuid], form=form)
+ # Re #110 offer the default minutes
+ using_default_minutes = False
+ if form.minutes_between_check.data == None:
+ form.minutes_between_check.data = datastore.data['settings']['requests']['minutes_between_check']
+ using_default_minutes = True
+
+ output = render_template("edit.html",
+ uuid=uuid,
+ watch=datastore.data['watching'][uuid],
+ form=form,
+ using_default_minutes=using_default_minutes
+ )
return output
diff --git a/backend/html_tools.py b/backend/html_tools.py
index 904910d2..d71c4fbd 100644
--- a/backend/html_tools.py
+++ b/backend/html_tools.py
@@ -13,11 +13,14 @@ def css_filter(css_filter, html_content):
# Extract/find element
def extract_element(find='title', html_content=''):
- html_title = False
+
+ #Re #106, be sure to handle when its not found
+ element_text = None
soup = BeautifulSoup(html_content, 'html.parser')
- title = soup.find(find)
- if title and title.string is not None:
- html_title = title.string.strip()
+ result = soup.find(find)
+ if result and result.string:
+ element_text = result.string.strip()
+
+ return element_text
- return html_title
diff --git a/backend/store.py b/backend/store.py
index af1478c6..0289dd7d 100644
--- a/backend/store.py
+++ b/backend/store.py
@@ -54,7 +54,9 @@ class ChangeDetectionStore:
'last_viewed': 0, # history key value of the last viewed via the [diff] link
'newest_history_key': "",
'title': None,
- 'minutes_between_check': 3 * 60, # Default 3 hours
+ # Re #110, so then if this is set to None, we know to use the default value instead
+ # Requires setting to None on submit if it's the same as the default
+ 'minutes_between_check': None,
'previous_md5': "",
'uuid': str(uuid_builder.uuid4()),
'headers': {}, # Extra headers to send
@@ -185,6 +187,10 @@ class ChangeDetectionStore:
self.__data['watching'][uuid]['viewed'] = False
has_unviewed = True
+ # #106 - Be sure this is None on empty string, False, None, etc
+ if not self.__data['watching'][uuid]['title']:
+ self.__data['watching'][uuid]['title'] = None
+
self.__data['has_unviewed'] = has_unviewed
return self.__data
diff --git a/backend/templates/edit.html b/backend/templates/edit.html
index eb794a60..3e828e49 100644
--- a/backend/templates/edit.html
+++ b/backend/templates/edit.html
@@ -15,6 +15,11 @@
{{ render_field(form.minutes_between_check, size=5) }}
+ {% if using_default_minutes %}
+ Currently using the default global settings, change to another value if you want to be specific.
+ {% else %}
+ Set to blank to use the default global settings.
+ {% endif %}
{{ render_field(form.css_filter, size=25, placeholder=".class-name or #some-id, or other CSS selector rule.") }}
diff --git a/backend/templates/settings.html b/backend/templates/settings.html
index 457e5f4b..177b834c 100644
--- a/backend/templates/settings.html
+++ b/backend/templates/settings.html
@@ -8,12 +8,14 @@