fix has proxies
This commit is contained in:
@@ -43,6 +43,7 @@ class model(watch_base):
|
|||||||
self.__datastore_path = kw.get('datastore_path')
|
self.__datastore_path = kw.get('datastore_path')
|
||||||
if kw.get('datastore_path'):
|
if kw.get('datastore_path'):
|
||||||
del kw['datastore_path']
|
del kw['datastore_path']
|
||||||
|
|
||||||
super(model, self).__init__(*arg, **kw)
|
super(model, self).__init__(*arg, **kw)
|
||||||
if kw.get('default'):
|
if kw.get('default'):
|
||||||
self.update(kw['default'])
|
self.update(kw['default'])
|
||||||
@@ -659,16 +660,15 @@ class model(watch_base):
|
|||||||
available.append(step_n.group(1))
|
available.append(step_n.group(1))
|
||||||
return available
|
return available
|
||||||
|
|
||||||
@property
|
def compile_error_texts(self, has_proxies=None):
|
||||||
def compile_error_texts(self):
|
"""Compile error texts for this watch.
|
||||||
|
Accepts has_proxies parameter to ensure it works even outside app context"""
|
||||||
from flask import (
|
from flask import (
|
||||||
Markup, url_for
|
Markup, url_for
|
||||||
)
|
)
|
||||||
|
|
||||||
output = ""
|
output = [] # Initialize as list since we're using append
|
||||||
last_error = self.get('last_error','')
|
last_error = self.get('last_error','')
|
||||||
has_proxies = datastore.proxy_list
|
|
||||||
|
|
||||||
if last_error and '403' in last_error:
|
if last_error and '403' in last_error:
|
||||||
if has_proxies:
|
if has_proxies:
|
||||||
@@ -679,8 +679,6 @@ class model(watch_base):
|
|||||||
if self.get('last_notification_error'):
|
if self.get('last_notification_error'):
|
||||||
output.append(str(Markup(f"<div class=\"notification-error\"><a href=\"{url_for('settings.notification_logs')}\">{ self.get('last_notification_error') }</a></div>")))
|
output.append(str(Markup(f"<div class=\"notification-error\"><a href=\"{url_for('settings.notification_logs')}\">{ self.get('last_notification_error') }</a></div>")))
|
||||||
|
|
||||||
|
|
||||||
res = "\n".join(output)
|
res = "\n".join(output)
|
||||||
|
|
||||||
return res
|
return res
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user