Skip to content

Commit 853cf05

Browse files
committed
[TradingView] disable email alerts
1 parent 34391b5 commit 853cf05

File tree

2 files changed

+22
-12
lines changed

2 files changed

+22
-12
lines changed

Services/Interfaces/web_interface/templates/extensions.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ <h3>
112112
Using OctoBot with the {{OCTOBOT_EXTENSION_PACKAGE_1_NAME}} makes TradingView strategies automation:
113113
<ul>
114114
<li>
115-
Free: No TradingView subscription is required to use email alerts, no Ngrok subscription is needed for webhooks
115+
Simple: Use OctoBot cloud webhooks - no Ngrok subscription is needed for webhooks
116116
</li>
117117
<li>
118118
Easy: You get a unique alert email address and webhook URL you can use rightaway

Services/Services_bases/trading_view_service/trading_view.py

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,12 @@ def has_required_configuration(self):
4343
return True
4444

4545
def get_required_config(self):
46-
return [services_constants.CONFIG_REQUIRE_TRADING_VIEW_TOKEN,
47-
services_constants.CONFIG_TRADING_VIEW_TOKEN,
48-
services_constants.CONFIG_TRADING_VIEW_USE_EMAIL_ALERTS]
46+
return [
47+
services_constants.CONFIG_REQUIRE_TRADING_VIEW_TOKEN,
48+
services_constants.CONFIG_TRADING_VIEW_TOKEN,
49+
# disabled until TradingView email alerts are restored
50+
# services_constants.CONFIG_TRADING_VIEW_USE_EMAIL_ALERTS
51+
]
4952

5053
def get_fields_description(self):
5154
return {
@@ -66,7 +69,8 @@ def get_default_value(self):
6669
return {
6770
services_constants.CONFIG_REQUIRE_TRADING_VIEW_TOKEN: False,
6871
services_constants.CONFIG_TRADING_VIEW_TOKEN: self.get_security_token(uuid.uuid4().hex),
69-
services_constants.CONFIG_TRADING_VIEW_USE_EMAIL_ALERTS: False,
72+
# disabled until TradingView email alerts are restored
73+
# services_constants.CONFIG_TRADING_VIEW_USE_EMAIL_ALERTS: False,
7074
}
7175

7276
def is_improved_by_extensions(self) -> bool:
@@ -81,10 +85,12 @@ def get_read_only_info(self) -> list[services.ReadOnlyInfo]:
8185
configuration_title="Configure on TradingView", configuration_path="tradingview_email_config"
8286
))
8387
else:
84-
read_only_info.append(services.ReadOnlyInfo(
85-
'Email address:', "Generate email", services_enums.ReadOnlyInfoType.CTA,
86-
path="tradingview_email_config"
87-
))
88+
pass
89+
# disabled until TradingView email alerts are restored
90+
# read_only_info.append(services.ReadOnlyInfo(
91+
# 'Email address:', "Generate email", services_enums.ReadOnlyInfoType.CTA,
92+
# path="tradingview_email_config"
93+
# ))
8894
if self._webhook_url:
8995
read_only_info.append(services.ReadOnlyInfo(
9096
'Webhook url:',
@@ -120,8 +126,9 @@ async def prepare(self) -> None:
120126
self.config[services_constants.CONFIG_CATEGORY_SERVICES][services_constants.CONFIG_TRADING_VIEW][
121127
services_constants.CONFIG_TRADING_VIEW_TOKEN]
122128
self.use_email_alert = \
123-
self.config[services_constants.CONFIG_CATEGORY_SERVICES][services_constants.CONFIG_TRADING_VIEW][
124-
services_constants.CONFIG_TRADING_VIEW_USE_EMAIL_ALERTS]
129+
self.config[services_constants.CONFIG_CATEGORY_SERVICES][services_constants.CONFIG_TRADING_VIEW].get(
130+
services_constants.CONFIG_TRADING_VIEW_USE_EMAIL_ALERTS, False
131+
)
125132
except KeyError:
126133
if self.requires_token is None:
127134
self.requires_token = self.get_default_value()[services_constants.CONFIG_REQUIRE_TRADING_VIEW_TOKEN]
@@ -133,8 +140,11 @@ async def prepare(self) -> None:
133140
updated_config = {
134141
services_constants.CONFIG_REQUIRE_TRADING_VIEW_TOKEN: self.requires_token,
135142
services_constants.CONFIG_TRADING_VIEW_TOKEN: self.token,
136-
services_constants.CONFIG_TRADING_VIEW_USE_EMAIL_ALERTS: self.use_email_alert,
137143
}
144+
if self.use_email_alert:
145+
# only save CONFIG_TRADING_VIEW_USE_EMAIL_ALERTS if use_email_alert is True
146+
# (to keep the option of users still using it)
147+
updated_config[services_constants.CONFIG_TRADING_VIEW_USE_EMAIL_ALERTS] = self.use_email_alert
138148
self.save_service_config(services_constants.CONFIG_TRADING_VIEW, updated_config)
139149

140150
@staticmethod

0 commit comments

Comments
 (0)