From d78d535dcda5dd43573b64f08a8ac4c493e1920e Mon Sep 17 00:00:00 2001 From: dgtlmoon Date: Thu, 13 Jun 2024 10:54:25 +0200 Subject: [PATCH] fixing variable fetch --- changedetectionio/flask_app.py | 2 +- changedetectionio/model/App.py | 1 + changedetectionio/store.py | 4 ++-- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/changedetectionio/flask_app.py b/changedetectionio/flask_app.py index 3a3bb0f86..16a0b8066 100644 --- a/changedetectionio/flask_app.py +++ b/changedetectionio/flask_app.py @@ -472,7 +472,7 @@ def changedetection_app(config=None, datastore_o=None): # Don't link to hosting when we're on the hosting environment active_tag=active_tag, active_tag_uuid=active_tag_uuid, - app_rss_token=datastore.data['settings']['application']['rss_access_token'], + app_rss_token=datastore.data['settings']['application'].get('rss_access_token'), datastore=datastore, errored_count=errored_count, form=form, diff --git a/changedetectionio/model/App.py b/changedetectionio/model/App.py index 75384f170..229ae2d7e 100644 --- a/changedetectionio/model/App.py +++ b/changedetectionio/model/App.py @@ -46,6 +46,7 @@ class model(dict): 'pager_size': 50, 'password': False, 'render_anchor_tag_content': False, + 'rss_access_token': None, 'schema_version' : 0, 'shared_diff_access': False, 'webdriver_delay': None , # Extra delay in seconds before extracting text diff --git a/changedetectionio/store.py b/changedetectionio/store.py index 6e84ac2fc..d11e72432 100644 --- a/changedetectionio/store.py +++ b/changedetectionio/store.py @@ -124,12 +124,12 @@ class ChangeDetectionStore: self.__data['app_guid'] = str(uuid_builder.uuid4()) # Generate the URL access token for RSS feeds - if not 'rss_access_token' in self.__data['settings']['application']: + if not self.__data['settings']['application'].get('rss_access_token'): secret = secrets.token_hex(16) self.__data['settings']['application']['rss_access_token'] = secret # Generate the API access token - if not 'api_access_token' in self.__data['settings']['application']: + if not self.__data['settings']['application'].get('api_access_token'): secret = secrets.token_hex(16) self.__data['settings']['application']['api_access_token'] = secret