From b6d4140501923b985ef171ccc207a36d0a36d3c4 Mon Sep 17 00:00:00 2001 From: dgtlmoon Date: Fri, 16 May 2025 15:21:10 +0200 Subject: [PATCH] fix has proxies --- changedetectionio/model/Watch.py | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/changedetectionio/model/Watch.py b/changedetectionio/model/Watch.py index 48692a24..65fa6af9 100644 --- a/changedetectionio/model/Watch.py +++ b/changedetectionio/model/Watch.py @@ -43,6 +43,7 @@ class model(watch_base): self.__datastore_path = kw.get('datastore_path') if kw.get('datastore_path'): del kw['datastore_path'] + super(model, self).__init__(*arg, **kw) if kw.get('default'): self.update(kw['default']) @@ -659,16 +660,15 @@ class model(watch_base): available.append(step_n.group(1)) return available - @property - def compile_error_texts(self): - + def compile_error_texts(self, has_proxies=None): + """Compile error texts for this watch. + Accepts has_proxies parameter to ensure it works even outside app context""" from flask import ( Markup, url_for ) - output = "" + output = [] # Initialize as list since we're using append last_error = self.get('last_error','') - has_proxies = datastore.proxy_list if last_error and '403' in last_error: if has_proxies: @@ -679,8 +679,6 @@ class model(watch_base): if self.get('last_notification_error'): output.append(str(Markup(f"
{ self.get('last_notification_error') }
"))) - res = "\n".join(output) - return res