Added Send SMS function to traveller contacts. The send command is commented out.
This commit is contained in:
@@ -1,8 +1,10 @@
|
||||
from django.contrib.admin.views.decorators import staff_member_required
|
||||
from django.http import HttpResponseRedirect
|
||||
from django.shortcuts import render
|
||||
|
||||
from .context_helpers import *
|
||||
from .email_helpers import render_to_pdf
|
||||
from .form import SMSForm
|
||||
|
||||
|
||||
@staff_member_required
|
||||
@@ -18,3 +20,19 @@ def emergency_contacts(request):
|
||||
@staff_member_required
|
||||
def bus_roll(request):
|
||||
return render_to_pdf('reports/bus_roll.html', bus_roll_context())
|
||||
|
||||
|
||||
def sms_message(request, queryset):
|
||||
if request.method == 'POST':
|
||||
form = SMSForm(request.POST)
|
||||
if form.is_valid():
|
||||
print("Hello world")
|
||||
HttpResponseRedirect(request.get_full_path())
|
||||
else:
|
||||
print("Form not valid")
|
||||
|
||||
else:
|
||||
print("Hello new world")
|
||||
form = SMSForm()
|
||||
|
||||
return render(request, 'admin/sms_form.html', context={'form': form, 'travellers': queryset})
|
||||
|
||||
Reference in New Issue
Block a user