From ceb967e6c7daf08b7c5431d8626f28e6816a23d5 2016-09-14 04:59:25 From: Christopher Neugebauer Date: 2016-09-14 04:59:25 Subject: [PATCH] Merge branch 'chrisjrn/review_page' --- diff --git a/registrasion/urls.py b/registrasion/urls.py index ac7faace42b3e9f3ef52f10eb5f6dff9cfb2b7ad..4d7463883683c6ca91134a74c4857d9b13b4890b 100644 --- a/registrasion/urls.py +++ b/registrasion/urls.py @@ -4,16 +4,17 @@ from django.conf.urls import include from django.conf.urls import url from .views import ( - product_category, + amend_registration, checkout, credit_note, + edit_profile, + guided_registration, invoice, + invoice_access, manual_payment, + product_category, refund, - invoice_access, - edit_profile, - guided_registration, - amend_registration, + review, ) @@ -33,6 +34,7 @@ public = [ name="invoice_access"), url(r"^profile$", edit_profile, name="attendee_edit"), url(r"^register$", guided_registration, name="guided_registration"), + url(r"^review$", review, name="review"), url(r"^register/([0-9]+)$", guided_registration, name="guided_registration"), ] diff --git a/registrasion/views.py b/registrasion/views.py index 704b05c222e1647a2419dc565971fc07e8913556..f272593a3fd5b13ffeb559163499e0d0221ce0fc 100644 --- a/registrasion/views.py +++ b/registrasion/views.py @@ -98,11 +98,7 @@ def guided_registration(request): attendee = people.Attendee.get_instance(request.user) if attendee.completed_registration: - return render( - request, - "registrasion/guided_registration_complete.html", - {}, - ) + return redirect(review) # Step 1: Fill in a badge and collect a voucher code try: @@ -234,6 +230,17 @@ def guided_registration(request): 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 def edit_profile(request): ''' 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: # Only return to the dashboard if we didn't add a voucher code # and if there's no errors in the products form - messages.success( - request, - "Your reservations have been updated.", - ) - return redirect("dashboard") + if products_form.has_changed(): + messages.success( + request, + "Your reservations have been updated.", + ) + return redirect(review) data = { "category": category,