Added function to email schools shuttle rolls.

This commit is contained in:
John Mullins
2025-02-18 15:40:38 +11:00
parent 034b9f7d91
commit af2f47b7f9
2 changed files with 34 additions and 2 deletions
+6 -2
View File
@@ -13,7 +13,7 @@ from rangefilter.filters import DateRangeFilterBuilder
from .adminClone import CloneModelAdmin
from .context_helpers import *
from .email_helpers import email_companies_bus_roll, render_to_pdf, email_school_roll, \
email_companies_emergency_contacts
email_companies_emergency_contacts, email_school_shuttle_roll
from .forms import roll_date_selector
from .models import *
from .utils.send_sms import send_sms
@@ -62,6 +62,10 @@ class ShuttleRollMixin:
buses.append(shuttle.bus)
return render_to_pdf('reports/bus_roll.html', bus_roll_context(buses, include_bus_stops=False))
def email_shuttle_roll(self, request, queryset):
return email_school_shuttle_roll(request, queryset)
class SchoolRollMixin:
@@ -295,7 +299,7 @@ class SettingAdmin(MyImportExportModelAdmin, admin.ModelAdmin):
@admin.register(Shuttle)
class ShuttleAdmin(MyImportExportModelAdmin, admin.ModelAdmin, ShuttleRollMixin):
list_display = ["__str__", "school", "bus", "shuttle_travellers"]
actions = ["show_shuttle_roll"]
actions = ["show_shuttle_roll", "email_shuttle_roll"]
def shuttle_travellers(self, obj):
url = (