Skip to content

Commit

Permalink
Guard logic with if condition to prevent attribute error
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnMwashuma committed Aug 6, 2024
1 parent 085884a commit 9b3af9b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2025,6 +2025,8 @@ def create_results_power_point_headers(tally_id, filtered_electrol_races, qs):
registrants_in_processed_stations = 0
for station in station_ids_by_races:
station_obj = stations_by_id.get(station.get('id'))
if station_obj is None:
continue
# Calculate stations processed and total registrants
form_states =\
ResultForm.objects.filter(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,8 @@ def get_initial_queryset(self):
registrants_in_processed_stations = 0
for station in station_ids_by_race:
station_obj = stations_by_id.get(station.get('id'))
if station_obj is None:
continue
# Calculate stations processed and total registrants
form_states = get_result_forms_for_station_in_admin_area(
tally_id,
Expand Down

0 comments on commit 9b3af9b

Please sign in to comment.