Moved active status to a database entry apposed to a function
Added settings page Cleaned up rollover page
This commit is contained in:
@@ -33,7 +33,7 @@ def school_roll_context(queryset):
|
||||
travellers = []
|
||||
for trav_route in TravellerRoute.objects.filter(query).filter(busStop__bus=bus).order_by('busStop__am_time'):
|
||||
traveller = trav_route.traveller
|
||||
if not traveller.is_active():
|
||||
if not traveller._is_active():
|
||||
continue
|
||||
bus_stop = trav_route.busStop
|
||||
|
||||
@@ -82,7 +82,7 @@ def route_paged_context(bus):
|
||||
traveller_list = []
|
||||
for trav_route in traveller_routes:
|
||||
traveller = trav_route.traveller
|
||||
if not traveller.is_active():
|
||||
if not traveller._is_active():
|
||||
continue
|
||||
is_fared = "---"
|
||||
if traveller.eligibility_status == "2":
|
||||
@@ -114,17 +114,18 @@ def route_paged_context(bus):
|
||||
def shuttle_route_context(shuttle):
|
||||
shuttle_travellers = []
|
||||
for traveller in Traveller.objects.filter(shuttle=shuttle):
|
||||
if traveller.is_active():
|
||||
if traveller._is_active():
|
||||
shuttle_travellers.append({
|
||||
'display': f"{traveller} ({traveller.get_year_level_display()}, {traveller.school})",
|
||||
})
|
||||
return {'shuttle': shuttle, 'shuttle_travellers': shuttle_travellers}
|
||||
|
||||
|
||||
def school_travellerRoute_context(school):
|
||||
travellers = []
|
||||
for travellerRoute in TravellerRoute.objects.filter(traveller__school=school):
|
||||
traveller = travellerRoute.traveller
|
||||
if not traveller.is_active():
|
||||
if not traveller._is_active():
|
||||
continue
|
||||
travellers.append(traveller_route_context(travellerRoute))
|
||||
return travellers
|
||||
@@ -165,7 +166,7 @@ def emergency_contacts_context(queryset=None):
|
||||
traveller_list = []
|
||||
for travellerRoute in TravellerRoute.objects.filter(busStop__bus=bus):
|
||||
traveller = travellerRoute.traveller
|
||||
if not traveller.is_active():
|
||||
if not traveller._is_active():
|
||||
continue
|
||||
parent_a = ""
|
||||
if travellerRoute.traveller.parent_A_firstname:
|
||||
@@ -206,7 +207,7 @@ def bus_summary_context():
|
||||
|
||||
traveller_count = 0
|
||||
for travellerRoute in TravellerRoute.objects.filter(busStop__bus=bus):
|
||||
if travellerRoute.traveller.is_active():
|
||||
if travellerRoute.traveller._is_active():
|
||||
traveller_count += 1
|
||||
|
||||
shuttle_name = ""
|
||||
@@ -218,7 +219,7 @@ def bus_summary_context():
|
||||
shuttle_name += f", {shuttle.school.shortName}"
|
||||
|
||||
for traveller in Traveller.objects.filter(shuttle=shuttle):
|
||||
if traveller.is_active():
|
||||
if traveller._is_active():
|
||||
shuttle_count += 1
|
||||
|
||||
over_capacity = traveller_count > bus.seating_capacity or shuttle_count > bus.seating_capacity
|
||||
|
||||
Reference in New Issue
Block a user