mirror of
https://git.ianrenton.com/ian/spothole.git
synced 2025-12-16 17:13:39 +00:00
Improve SIG Ref lookup
This commit is contained in:
@@ -7,7 +7,7 @@ from datetime import datetime, timedelta
|
||||
import pytz
|
||||
|
||||
from core.lookup_helper import lookup_helper
|
||||
from core.sig_utils import get_icon_for_sig, get_sig_ref_info
|
||||
from core.sig_utils import get_icon_for_sig, populate_sig_ref_info
|
||||
|
||||
|
||||
# Data class that defines an alert.
|
||||
@@ -102,10 +102,7 @@ class Alert:
|
||||
# from WAB and WAI, which count as a SIG even though there's no real lookup, just maths
|
||||
if self.sig_refs and len(self.sig_refs) > 0:
|
||||
for sig_ref in self.sig_refs:
|
||||
lookup_data = get_sig_ref_info(sig_ref.sig, sig_ref.id)
|
||||
if lookup_data:
|
||||
# Update the sig_ref data from the lookup
|
||||
sig_ref.__dict__.update(lookup_data.__dict__)
|
||||
populate_sig_ref_info(sig_ref)
|
||||
|
||||
# If the spot itself doesn't have a SIG yet, but we have at least one SIG reference, take that reference's SIG
|
||||
# and apply it to the whole spot.
|
||||
|
||||
Reference in New Issue
Block a user