Changeset - 26af6e86720f
[Not reviewed]
0 1 0
Christopher Neugebauer - 8 years ago 2016-04-02 00:33:20
chrisjrn@gmail.com
Adds messages when items are updated; disables product forms when there are no products available.
1 file changed with 22 insertions and 0 deletions:
0 comments (0 inline, 0 general)
registrasion/views.py
Show inline comments
...
 
@@ -121,6 +121,10 @@ def guided_registration(request, page_id=0):
 
                category=category,
 
            )
 

	
 
            if not products:
 
                # This product category does not exist for this user
 
                continue
 

	
 
            prefix = "category_" + str(category.id)
 
            p = handle_products(request, category, products, prefix)
 
            products_form, discounts, products_handled = p
...
 
@@ -160,6 +164,13 @@ def guided_registration(request, page_id=0):
 
def edit_profile(request):
 
    form, handled = handle_profile(request, "profile")
 

	
 
    if handled and not form.errors:
 
        messages.success(
 
            request,
 
            "Your attendee profile was updated.",
 
        )
 
        return redirect("dashboard")
 

	
 
    data = {
 
        "form": form,
 
    }
...
 
@@ -229,12 +240,23 @@ def product_category(request, category_id):
 
        category=category,
 
    )
 

	
 
    if not products:
 
        messages.warning(
 
            request,
 
            "There are no products available from category: "+ category.name,
 
        )
 
        return redirect("dashboard")
 

	
 
    p = handle_products(request, category, products, PRODUCTS_FORM_PREFIX)
 
    products_form, discounts, products_handled = p
 

	
 
    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")
 

	
 
    data = {
0 comments (0 inline, 0 general)