Files
bus-manager/busManager/coord/scheduled_tasks.py
T
John Mullins d74290036e Moved where active status is displayed.
Cleaned up logout redirects
Added suburbs admin page back. Wasn't able to create new suburbs
Made active status check to any traveller save function
2023-12-22 16:50:30 +11:00

12 lines
449 B
Python

from .models import Traveller
def nightly_check_active_status():
for traveller in Traveller.objects.all():
start_date = traveller.travel_start_date
end_date = traveller.travel_end_date
is_active = traveller.is_active
traveller._update_active_status()
if start_date != traveller.travel_start_date or end_date != traveller.travel_end_date or is_active != traveller.is_active:
traveller.save()