Changeset - 8d66ed57150d
[Not reviewed]
0 6 0
Christopher Neugebauer - 8 years ago 2016-03-25 03:51:39
chrisjrn@gmail.com
Fix flake8 warnings
6 files changed with 22 insertions and 14 deletions:
0 comments (0 inline, 0 general)
registrasion/forms.py
Show inline comments
...
 
@@ -45,3 +45,2 @@ def CategoryForm(category):
 

	
 

	
 
    products = rego.Product.objects.filter(category=category).order_by("order")
registrasion/templatetags/registrasion_tags.py
Show inline comments
...
 
@@ -6,2 +6,3 @@ register = template.Library()
 

	
 

	
 
@register.assignment_tag(takes_context=True)
registrasion/tests/test_discount.py
Show inline comments
...
 
@@ -210,3 +210,3 @@ class DiscountTestCase(RegistrationCartTestCase):
 
            cart = CartController.for_user(user)
 
            cart.add_to_cart(self.PROD_1, 1) # Enable the discount
 
            cart.add_to_cart(self.PROD_1, 1)  # Enable the discount
 
            cart.add_to_cart(self.PROD_3, 1)
registrasion/tests/test_voucher.py
Show inline comments
...
 
@@ -97,9 +97,9 @@ class VoucherTestCases(RegistrationCartTestCase):
 
    def test_voucher_codes_unique(self):
 
        voucher1 = self.new_voucher(code="VOUCHER")
 
        self.new_voucher(code="VOUCHER")
 
        with self.assertRaises(IntegrityError):
 
            voucher2 = self.new_voucher(code="VOUCHER")
 
            self.new_voucher(code="VOUCHER")
 

	
 
    def test_multiple_vouchers_work(self):
 
        voucher1 = self.new_voucher(code="VOUCHER1")
 
        voucher2 = self.new_voucher(code="VOUCHER2")
 
        self.new_voucher(code="VOUCHER1")
 
        self.new_voucher(code="VOUCHER2")
 

	
registrasion/urls.py
Show inline comments
...
 
@@ -10,3 +10,4 @@ urlpatterns = patterns(
 
    url(r"^register$", "guided_registration", name="guided_registration"),
 
    url(r"^register/([0-9]+)$", "guided_registration", name="guided_registration"),
 
    url(r"^register/([0-9]+)$", "guided_registration",
 
        name="guided_registration"),
 
)
registrasion/views.py
Show inline comments
...
 
@@ -4,3 +4,2 @@ from registrasion.controllers.cart import CartController
 
from registrasion.controllers.invoice import InvoiceController
 
from registrasion.controllers.product import ProductController
 

	
...
 
@@ -85,2 +84,3 @@ def edit_profile(request):
 

	
 

	
 
@login_required
...
 
@@ -105,7 +105,13 @@ def product_category(request, category_id):
 
    if request.method == "POST":
 
        cat_form = CategoryForm(request.POST, request.FILES, prefix=PRODUCTS_FORM_PREFIX)
 
        cat_form = CategoryForm(
 
            request.POST,
 
            request.FILES,
 
            prefix=PRODUCTS_FORM_PREFIX)
 
        cat_form.disable_products_for_user(request.user)
 
        voucher_form = forms.VoucherForm(request.POST, prefix=VOUCHERS_FORM_PREFIX)
 
        voucher_form = forms.VoucherForm(
 
            request.POST,
 
            prefix=VOUCHERS_FORM_PREFIX)
 

	
 
        if voucher_form.is_valid() and voucher_form.cleaned_data["voucher"].strip():
 
        if (voucher_form.is_valid() and
 
                voucher_form.cleaned_data["voucher"].strip()):
 
            # Apply voucher
...
 
@@ -121,3 +127,3 @@ def product_category(request, category_id):
 
                handle_valid_cat_form(cat_form, current_cart)
 
            except ValidationError as ve:
 
            except ValidationError:
 
                pass
...
 
@@ -155,3 +161,2 @@ def product_category(request, category_id):
 
            # Only add items that are enabled.
 
            prod = ProductController(product)
 
            try:
...
 
@@ -168,3 +173,2 @@ def product_category(request, category_id):
 

	
 

	
 
    data = {
...
 
@@ -177,2 +181,3 @@ def product_category(request, category_id):
 

	
 

	
 
@transaction.atomic
...
 
@@ -189,2 +194,3 @@ def handle_valid_cat_form(cat_form, current_cart):
 

	
 

	
 
@login_required
...
 
@@ -214,2 +220,3 @@ def invoice(request, invoice_id):
 

	
 

	
 
@login_required
0 comments (0 inline, 0 general)