Changeset - 76e6206d0987
[Not reviewed]
0 1 0
Christopher Neugebauer - 8 years ago 2016-04-29 01:08:45
chrisjrn@gmail.com
Wraps the guided registration handler in views.py in a batch marker
1 file changed with 5 insertions and 3 deletions:
0 comments (0 inline, 0 general)
registrasion/views.py
Show inline comments
...
 
@@ -180,8 +180,9 @@ def guided_registration(request):
 
            attendee.completed_registration = True
 
            attendee.save()
 
            return next_step
 

	
 
        with CartController.operations_batch(request.user):
 
            for category in cats:
 
                products = [
 
                    i for i in available_products
 
                    if i.category == category
...
 
@@ -200,14 +201,15 @@ def guided_registration(request):
 

	
 
                if products:
 
                    # This product category has items to show.
 
                    sections.append(section)
 
                # Add this to the list of things to show if the form errors.
 
                    # Add this to the list of things to show if the form
 
                    # errors.
 
                    request.session[SESSION_KEY].append(category.id)
 

	
 
                    if request.method == "POST" and not products_form.errors:
 
                    # This is only saved if we pass each form with no errors,
 
                    # and if the form actually has products.
 
                        # This is only saved if we pass each form with no
 
                        # errors, and if the form actually has products.
 
                        attendee.guided_categories_complete.add(category)
 

	
 
    if sections and request.method == "POST":
 
        for section in sections:
0 comments (0 inline, 0 general)