Skip to content

Commit

Permalink
use generate_widget_data in update_result
Browse files Browse the repository at this point in the history
  • Loading branch information
atalyaalon committed Dec 28, 2024
1 parent 682f4b5 commit 5b0afb8
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions anyway/widgets/road_segment_widgets/street_view_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,7 @@ def localize_items(request_params: RequestParams, items: Dict) -> Dict:

@classmethod
def update_result(cls, request_params: RequestParams, cached_items: Dict) -> Optional[Dict]:
if cls.is_relevant(request_params):
w = cls(request_params) # pylint: disable=E1120
try:
w.generate_items()
updated_widget_data = w.serialize()
return updated_widget_data if w.is_included() else None
except Exception as e:
logging.debug(f"Encountered error when generating items for {w.name} : {e}")
try:
return cls.generate_widget_data(request_params)
except Exception as e:
logging.debug(f"Encountered error when generating items for widget class {cls} : {e}")

0 comments on commit 5b0afb8

Please sign in to comment.