@@ -37,15 +37,8 @@ def from_object(cls, value: object) -> "StrategyPluginGoogleVoiceSettings":
3737 return cls (
3838 smtp_host = _get_value (value , "crisis_alert_smtp_host" ),
3939 smtp_port = int (_get_value (value , "crisis_alert_smtp_port" , 587 ) or 587 ),
40- sender = _first_non_empty (
41- _get_value (value , "crisis_alert_smtp_from" ),
42- _get_value (value , "crisis_alert_google_voice_from" ),
43- _get_value (value , "crisis_alert_email_from" ),
44- ),
45- recipients = _merge_recipients (
46- _get_value (value , "crisis_alert_google_voice_to" , ()),
47- _get_value (value , "crisis_alert_email_to" , ()),
48- ),
40+ sender = _first_non_empty (_get_value (value , "crisis_alert_smtp_from" )),
41+ recipients = tuple (parse_email_recipients (_get_value (value , "crisis_alert_google_voice_to" , ()))),
4942 username = _get_value (value , "crisis_alert_smtp_username" ),
5043 password = _get_value (value , "crisis_alert_smtp_password" ),
5144 use_starttls = _coerce_bool (_get_value (value , "crisis_alert_smtp_starttls" , True ), default = True ),
@@ -57,9 +50,9 @@ def missing_fields(self) -> tuple[str, ...]:
5750 if not str (self .smtp_host or "" ).strip ():
5851 missing .append ("CRISIS_ALERT_SMTP_HOST" )
5952 if not str (self .sender or "" ).strip ():
60- missing .append ("CRISIS_ALERT_SMTP_FROM/CRISIS_ALERT_EMAIL_FROM " )
53+ missing .append ("CRISIS_ALERT_SMTP_FROM" )
6154 if not parse_email_recipients (self .recipients ):
62- missing .append ("CRISIS_ALERT_GOOGLE_VOICE_TO/CRISIS_ALERT_EMAIL_TO " )
55+ missing .append ("CRISIS_ALERT_GOOGLE_VOICE_TO" )
6356 return tuple (missing )
6457
6558 @property
@@ -124,16 +117,13 @@ class StrategyPluginGoogleVoiceAlertMarkerStore:
124117 gcs_prefix_uri : str | None = None
125118 gcp_project_id : str | None = None
126119 namespace : str = "strategy_plugin_google_voice_alerts"
127- legacy_namespaces : tuple [str , ...] = ("strategy_plugin_email_alerts" ,)
128120 client_factory : Any = None
129121
130122 def has_alert (self , alert_key : str ) -> bool :
131- for candidate_key in _alert_key_candidates (alert_key ):
132- for namespace in (self .namespace , * self .legacy_namespaces ):
133- if self .gcs_prefix_uri and self ._gcs_blob (candidate_key , namespace = namespace ).exists ():
134- return True
135- if self .local_dir and self ._local_path (candidate_key , namespace = namespace ).exists ():
136- return True
123+ if self .gcs_prefix_uri and self ._gcs_blob (alert_key , namespace = self .namespace ).exists ():
124+ return True
125+ if self .local_dir and self ._local_path (alert_key , namespace = self .namespace ).exists ():
126+ return True
137127 return False
138128
139129 def record_alert (
@@ -377,18 +367,6 @@ def _first_non_empty(*values: Any) -> str | None:
377367 return None
378368
379369
380- def _merge_recipients (* values : Any ) -> tuple [str , ...]:
381- recipients : list [str ] = []
382- seen = set ()
383- for value in values :
384- for recipient in parse_email_recipients (value ):
385- if recipient in seen :
386- continue
387- recipients .append (recipient )
388- seen .add (recipient )
389- return tuple (recipients )
390-
391-
392370def _coerce_bool (value : Any , * , default : bool ) -> bool :
393371 if value is None :
394372 return default
@@ -404,18 +382,6 @@ def _fallback_alert_key(message: StrategyPluginAlertMessage) -> str:
404382 return "strategy_plugin_google_voice_alert/" + _clean_relative_key (message .subject or "unknown" )
405383
406384
407- def _alert_key_candidates (alert_key : str ) -> tuple [str , ...]:
408- key = str (alert_key or "" )
409- legacy_key = key .replace (
410- "strategy_plugin_google_voice_alert/" ,
411- "strategy_plugin_email_alert/" ,
412- 1 ,
413- )
414- if legacy_key != key :
415- return (key , legacy_key )
416- return (key ,)
417-
418-
419385def _clean_relative_key (value : str ) -> str :
420386 parts = []
421387 for raw_part in str (value or "" ).replace ("\\ " , "/" ).split ("/" ):
0 commit comments