Replaces the final stage of guided registration with a review page, which shows after adding anything to your cart.

Fixes #87
This commit is contained in:
Christopher Neugebauer 2016-09-14 14:59:01 +10:00
parent faa25c9b3a
commit 640db7e3dc
2 changed files with 26 additions and 16 deletions

View file

@ -4,16 +4,17 @@ from django.conf.urls import include
from django.conf.urls import url from django.conf.urls import url
from .views import ( from .views import (
product_category, amend_registration,
checkout, checkout,
credit_note, credit_note,
invoice,
manual_payment,
refund,
invoice_access,
edit_profile, edit_profile,
guided_registration, guided_registration,
amend_registration, invoice,
invoice_access,
manual_payment,
product_category,
refund,
review,
) )
@ -33,6 +34,7 @@ public = [
name="invoice_access"), name="invoice_access"),
url(r"^profile$", edit_profile, name="attendee_edit"), url(r"^profile$", edit_profile, name="attendee_edit"),
url(r"^register$", guided_registration, name="guided_registration"), url(r"^register$", guided_registration, name="guided_registration"),
url(r"^review$", review, name="review"),
url(r"^register/([0-9]+)$", guided_registration, url(r"^register/([0-9]+)$", guided_registration,
name="guided_registration"), name="guided_registration"),
] ]

View file

@ -98,11 +98,7 @@ def guided_registration(request):
attendee = people.Attendee.get_instance(request.user) attendee = people.Attendee.get_instance(request.user)
if attendee.completed_registration: if attendee.completed_registration:
return render( return redirect(review)
request,
"registrasion/guided_registration_complete.html",
{},
)
# Step 1: Fill in a badge and collect a voucher code # Step 1: Fill in a badge and collect a voucher code
try: try:
@ -234,6 +230,17 @@ def guided_registration(request):
return render(request, "registrasion/guided_registration.html", data) return render(request, "registrasion/guided_registration.html", data)
@login_required
def review(request):
''' View for the review page. '''
return render(
request,
"registrasion/guided_registration_complete.html",
{},
)
@login_required @login_required
def edit_profile(request): def edit_profile(request):
''' View for editing an attendee's profile ''' View for editing an attendee's profile
@ -370,11 +377,12 @@ def product_category(request, category_id):
if request.POST and not voucher_handled and not products_form.errors: if request.POST and not voucher_handled and not products_form.errors:
# Only return to the dashboard if we didn't add a voucher code # Only return to the dashboard if we didn't add a voucher code
# and if there's no errors in the products form # and if there's no errors in the products form
messages.success( if products_form.has_changed():
request, messages.success(
"Your reservations have been updated.", request,
) "Your reservations have been updated.",
return redirect("dashboard") )
return redirect(review)
data = { data = {
"category": category, "category": category,