Skip to content
This repository
  • 6 commits
  • 7 files changed
  • 0 comments
  • 1 contributor
20 oscar/apps/basket/middleware.py
@@ -4,9 +4,11 @@
4 4 from django.core.exceptions import SuspiciousOperation
5 5 from django.db.models import get_model
6 6
7   -from oscar.core.loading import import_module
8   -import_module('offer.utils', ['Applicator'], locals())
9   -basket_model = get_model('basket', 'basket')
  7 +from oscar.core.loading import get_class
  8 +from oscar.apps.basket.abstract_models import OPEN
  9 +
  10 +Applicator = get_class('offer.utils', 'Applicator')
  11 +Basket = get_model('basket', 'basket')
10 12
11 13
12 14 class BasketMiddleware(object):
@@ -18,7 +20,7 @@ def process_request(self, request):
18 20 request.basket = basket
19 21
20 22 def get_basket(self, request):
21   - manager = basket_model.open
  23 + manager = Basket.open
22 24 cookie_basket = self.get_cookie_basket(settings.OSCAR_BASKET_COOKIE_OPEN,
23 25 request, manager)
24 26
@@ -28,7 +30,7 @@ def get_basket(self, request):
28 30 # basket into their user basket, then delete the cookie
29 31 try:
30 32 basket, _ = manager.get_or_create(owner=request.user)
31   - except basket_model.MultipleObjectsReturned:
  33 + except Basket.MultipleObjectsReturned:
32 34 # Not sure quite how we end up here with multiple baskets
33 35 # We merge any them and create a fresh one
34 36 old_baskets = list(manager.filter(owner=request.user))
@@ -45,7 +47,7 @@ def get_basket(self, request):
45 47 else:
46 48 # Anonymous user with no basket - we don't save the basket until
47 49 # we need to.
48   - basket = basket_model()
  50 + basket = Basket()
49 51 return basket
50 52
51 53 def merge_baskets(self, master, slave):
@@ -57,7 +59,6 @@ def merge_baskets(self, master, slave):
57 59 master.merge(slave)
58 60
59 61 def process_response(self, request, response):
60   -
61 62 # Delete any surplus cookies
62 63 if hasattr(self, 'cookies_to_delete'):
63 64 for cookie_key in self.cookies_to_delete:
@@ -96,8 +97,9 @@ def get_cookie_basket(self, cookie_key, request, manager):
96 97 basket_id, basket_hash = parts
97 98 if basket_hash == self.get_basket_hash(basket_id):
98 99 try:
99   - basket = basket_model.objects.get(pk=basket_id, owner=None)
100   - except basket_model.DoesNotExist:
  100 + basket = Basket.objects.get(pk=basket_id, owner=None,
  101 + status=OPEN)
  102 + except Basket.DoesNotExist:
101 103 self.cookies_to_delete.append(cookie_key)
102 104 else:
103 105 self.cookies_to_delete.append(cookie_key)
20 oscar/apps/checkout/views.py
@@ -438,12 +438,17 @@ def place_order(self, order_number, basket, total_incl_tax, total_excl_tax, **kw
438 438 shipping_address = self.create_shipping_address()
439 439 shipping_method = self.get_shipping_method(basket)
440 440 billing_address = self.create_billing_address(shipping_address)
  441 +
441 442 if 'status' not in kwargs:
442 443 status = self.get_initial_order_status(basket)
443 444 else:
444 445 status = kwargs.pop('status')
445   - if not self.request.user.is_authenticated():
  446 +
  447 + # Set guest email address for anon checkout. Some libraries (eg
  448 + # PayPal) will pass this explicitly so we take care not to clobber.
  449 + if not self.request.user.is_authenticated() and 'guest_email' not in kwargs:
446 450 kwargs['guest_email'] = self.checkout_session.get_guest_email()
  451 +
447 452 order = OrderCreator().place_order(basket=basket,
448 453 total_incl_tax=total_incl_tax,
449 454 total_excl_tax=total_excl_tax,
@@ -739,10 +744,17 @@ def submit(self, basket, **kwargs):
739 744 logger.error("Order #%s: payment error (%s)", order_number, msg)
740 745 self.restore_frozen_basket()
741 746 return self.render_to_response(self.get_context_data(error="A problem occurred processing payment."))
742   - else:
743   - # If all is ok with payment, place order
744   - logger.info("Order #%s: payment successful, placing order", order_number)
  747 +
  748 + # If all is ok with payment, try and place order
  749 + logger.info("Order #%s: payment successful, placing order", order_number)
  750 + try:
745 751 return self.handle_order_placement(order_number, basket, total_incl_tax, total_excl_tax, **kwargs)
  752 + except UnableToPlaceOrder, e:
  753 + logger.warning("Order #%s: unable to place order - %s",
  754 + order_number, e)
  755 + msg = unicode(e)
  756 + self.restore_frozen_basket()
  757 + return self.render_to_response(self.get_context_data(error=msg))
746 758
747 759 def generate_order_number(self, basket):
748 760 generator = OrderNumberGenerator()
4 oscar/apps/order/exceptions.py
@@ -12,3 +12,7 @@ class InvalidLineStatus(InvalidStatus):
12 12
13 13 class InvalidShippingEvent(Exception):
14 14 pass
  15 +
  16 +
  17 +class UnableToPlaceOrder(Exception):
  18 + pass
380 oscar/fixtures/sample-products.json
... ... @@ -1 +1,379 @@
1   -[{"pk": 1, "model": "catalogue.productclass", "fields": {"options": [], "name": "DryGoods", "slug": "drygoods"}}, {"pk": 10, "model": "catalogue.product", "fields": {"description": null, "parent": null, "title": "Tetley's Cask 20oz Toughened Pint Glass (Pack of 24)", "date_updated": "2011-02-15 15:53:04", "upc": "074132", "product_options": [], "product_class": 1, "date_created": "2011-02-15 15:53:04", "slug": "tetleys-cask-20oz-toughened-pint-glass-pack-of-24"}}, {"pk": 4, "model": "catalogue.product", "fields": {"description": null, "parent": null, "title": "Carlsberg Bar Runner (Pack of 2)", "date_updated": "2011-02-15 15:53:03", "upc": "073729", "product_options": [], "product_class": 1, "date_created": "2011-02-15 15:53:03", "slug": "carlsberg-bar-runner-pack-of-2"}}, {"pk": 5, "model": "catalogue.product", "fields": {"description": null, "parent": null, "title": "Export Bar Runner (Pack of 2)", "date_updated": "2011-02-15 15:53:03", "upc": "073731", "product_options": [], "product_class": 1, "date_created": "2011-02-15 15:53:03", "slug": "export-bar-runner-pack-of-2"}}, {"pk": 6, "model": "catalogue.product", "fields": {"description": null, "parent": null, "title": "Tetley's Bar Runner (Pack of 2)", "date_updated": "2011-02-15 15:53:03", "upc": "073733", "product_options": [], "product_class": 1, "date_created": "2011-02-15 15:53:03", "slug": "tetleys-bar-runner-pack-of-2"}}, {"pk": 7, "model": "catalogue.product", "fields": {"description": null, "parent": null, "title": "Carlsberg Staff T-shirt (Pack of 5) ", "date_updated": "2011-02-15 15:53:03", "upc": "073850", "product_options": [], "product_class": 1, "date_created": "2011-02-15 15:53:03", "slug": "carlsberg-staff-t-shirt-pack-of-5"}}, {"pk": 8, "model": "catalogue.product", "fields": {"description": null, "parent": null, "title": "Carlsberg Waiter Tray (Pack of 5)", "date_updated": "2011-02-15 15:53:03", "upc": "073922", "product_options": [], "product_class": 1, "date_created": "2011-02-15 15:53:03", "slug": "carlsberg-waiter-tray-pack-of-5"}}, {"pk": 9, "model": "catalogue.product", "fields": {"description": null, "parent": null, "title": "Tetley's 20oz Toughened Pint Glass (Pack of 24)", "date_updated": "2011-02-15 15:53:03", "upc": "074127", "product_options": [], "product_class": 1, "date_created": "2011-02-15 15:53:03", "slug": "tetleys-20oz-toughened-pint-glass-pack-of-24"}}, {"pk": 1, "model": "catalogue.product", "fields": {"description": null, "parent": null, "title": "Carlsberg Golf Umbrella (Pack of 1)", "date_updated": "2011-02-15 15:53:02", "upc": "071216", "product_options": [], "product_class": 1, "date_created": "2011-02-15 15:53:02", "slug": "carlsberg-golf-umbrella-pack-of-1"}}, {"pk": 2, "model": "catalogue.product", "fields": {"description": null, "parent": null, "title": "Carlsberg Bunting - 5m (Pack of 2)", "date_updated": "2011-02-15 15:53:02", "upc": "072174", "product_options": [], "product_class": 1, "date_created": "2011-02-15 15:53:02", "slug": "carlsberg-bunting-5m-pack-of-2"}}, {"pk": 3, "model": "catalogue.product", "fields": {"description": null, "parent": null, "title": "Tetley's 22oz Toughened Pint Glass (Pack of 24)", "date_updated": "2011-02-15 15:53:02", "upc": "072261", "product_options": [], "product_class": 1, "date_created": "2011-02-15 15:53:02", "slug": "tetleys-22oz-toughened-pint-glass-pack-of-24"}}, {"pk": 1, "model": "partner.partner", "fields": {"name": "Prolog"}}, {"pk": 1, "model": "partner.stockrecord", "fields": {"price_currency": "GBP", "product": 1, "num_allocated": 0, "partner_sku": "071216", "num_in_stock": 0, "partner": 1, "price_excl_tax": "14.00"}}, {"pk": 2, "model": "partner.stockrecord", "fields": {"price_currency": "GBP", "product": 2, "num_allocated": 0, "partner_sku": "072174", "num_in_stock": 127, "partner": 1, "price_excl_tax": "7.32"}}, {"pk": 3, "model": "partner.stockrecord", "fields": {"price_currency": "GBP", "product": 3, "num_allocated": 0, "partner_sku": "072261", "num_in_stock": 662, "partner": 1, "price_excl_tax": "13.82"}}, {"pk": 4, "model": "partner.stockrecord", "fields": {"price_currency": "GBP", "product": 4, "num_allocated": 0, "partner_sku": "073729", "num_in_stock": 54, "partner": 1, "price_excl_tax": "8.00"}}, {"pk": 5, "model": "partner.stockrecord", "fields": {"price_currency": "GBP", "product": 5, "num_allocated": 0, "partner_sku": "073731", "num_in_stock": 391, "partner": 1, "price_excl_tax": "8.00"}}, {"pk": 6, "model": "partner.stockrecord", "fields": {"price_currency": "GBP", "product": 6, "num_allocated": 0, "partner_sku": "073733", "num_in_stock": 221, "partner": 1, "price_excl_tax": "8.00"}}, {"pk": 7, "model": "partner.stockrecord", "fields": {"price_currency": "GBP", "product": 7, "num_allocated": 5, "partner_sku": "073850", "num_in_stock": 90, "partner": 1, "price_excl_tax": "13.90"}}, {"pk": 8, "model": "partner.stockrecord", "fields": {"price_currency": "GBP", "product": 8, "num_allocated": 0, "partner_sku": "073922", "num_in_stock": 153, "partner": 1, "price_excl_tax": "6.99"}}, {"pk": 9, "model": "partner.stockrecord", "fields": {"price_currency": "GBP", "product": 9, "num_allocated": 0, "partner_sku": "074127", "num_in_stock": 654, "partner": 1, "price_excl_tax": "13.76"}}, {"pk": 10, "model": "partner.stockrecord", "fields": {"price_currency": "GBP", "product": 10, "num_allocated": 5, "partner_sku": "074132", "num_in_stock": 38, "partner": 1, "price_excl_tax": "16.06"}}]
  1 +[
  2 + {
  3 + "pk": 1,
  4 + "model": "catalogue.productclass",
  5 + "fields": {
  6 + "options": [],
  7 + "name": "DryGoods",
  8 + "slug": "drygoods"
  9 + }
  10 + },
  11 + {
  12 + "pk": 10,
  13 + "model": "catalogue.product",
  14 + "fields": {
  15 + "status": null,
  16 + "related_products": [],
  17 + "description": null,
  18 + "parent": null,
  19 + "title": "Tetley's Cask 20oz Toughened Pint Glass (Pack of 24)",
  20 + "date_updated": "2011-02-15 15:53:04",
  21 + "upc": "074132",
  22 + "score": 0.0,
  23 + "date_created": "2011-02-15 15:53:04",
  24 + "product_options": [],
  25 + "slug": "tetleys-cask-20oz-toughened-pint-glass-pack-of-24",
  26 + "product_class": 1
  27 + }
  28 + },
  29 + {
  30 + "pk": 4,
  31 + "model": "catalogue.product",
  32 + "fields": {
  33 + "status": null,
  34 + "related_products": [],
  35 + "description": null,
  36 + "parent": null,
  37 + "title": "Carlsberg Bar Runner (Pack of 2)",
  38 + "date_updated": "2011-02-15 15:53:03",
  39 + "upc": "073729",
  40 + "score": 0.0,
  41 + "date_created": "2011-02-15 15:53:03",
  42 + "product_options": [],
  43 + "slug": "carlsberg-bar-runner-pack-of-2",
  44 + "product_class": 1
  45 + }
  46 + },
  47 + {
  48 + "pk": 5,
  49 + "model": "catalogue.product",
  50 + "fields": {
  51 + "status": null,
  52 + "related_products": [],
  53 + "description": null,
  54 + "parent": null,
  55 + "title": "Export Bar Runner (Pack of 2)",
  56 + "date_updated": "2011-02-15 15:53:03",
  57 + "upc": "073731",
  58 + "score": 0.0,
  59 + "date_created": "2011-02-15 15:53:03",
  60 + "product_options": [],
  61 + "slug": "export-bar-runner-pack-of-2",
  62 + "product_class": 1
  63 + }
  64 + },
  65 + {
  66 + "pk": 6,
  67 + "model": "catalogue.product",
  68 + "fields": {
  69 + "status": null,
  70 + "related_products": [],
  71 + "description": null,
  72 + "parent": null,
  73 + "title": "Tetley's Bar Runner (Pack of 2)",
  74 + "date_updated": "2011-02-15 15:53:03",
  75 + "upc": "073733",
  76 + "score": 0.0,
  77 + "date_created": "2011-02-15 15:53:03",
  78 + "product_options": [],
  79 + "slug": "tetleys-bar-runner-pack-of-2",
  80 + "product_class": 1
  81 + }
  82 + },
  83 + {
  84 + "pk": 7,
  85 + "model": "catalogue.product",
  86 + "fields": {
  87 + "status": null,
  88 + "related_products": [],
  89 + "description": null,
  90 + "parent": null,
  91 + "title": "Carlsberg Staff T-shirt (Pack of 5) ",
  92 + "date_updated": "2011-02-15 15:53:03",
  93 + "upc": "073850",
  94 + "score": 0.0,
  95 + "date_created": "2011-02-15 15:53:03",
  96 + "product_options": [],
  97 + "slug": "carlsberg-staff-t-shirt-pack-of-5",
  98 + "product_class": 1
  99 + }
  100 + },
  101 + {
  102 + "pk": 8,
  103 + "model": "catalogue.product",
  104 + "fields": {
  105 + "status": null,
  106 + "related_products": [],
  107 + "description": null,
  108 + "parent": null,
  109 + "title": "Carlsberg Waiter Tray (Pack of 5)",
  110 + "date_updated": "2011-02-15 15:53:03",
  111 + "upc": "073922",
  112 + "score": 0.0,
  113 + "date_created": "2011-02-15 15:53:03",
  114 + "product_options": [],
  115 + "slug": "carlsberg-waiter-tray-pack-of-5",
  116 + "product_class": 1
  117 + }
  118 + },
  119 + {
  120 + "pk": 9,
  121 + "model": "catalogue.product",
  122 + "fields": {
  123 + "status": null,
  124 + "related_products": [],
  125 + "description": null,
  126 + "parent": null,
  127 + "title": "Tetley's 20oz Toughened Pint Glass (Pack of 24)",
  128 + "date_updated": "2011-02-15 15:53:03",
  129 + "upc": "074127",
  130 + "score": 0.0,
  131 + "date_created": "2011-02-15 15:53:03",
  132 + "product_options": [],
  133 + "slug": "tetleys-20oz-toughened-pint-glass-pack-of-24",
  134 + "product_class": 1
  135 + }
  136 + },
  137 + {
  138 + "pk": 1,
  139 + "model": "catalogue.product",
  140 + "fields": {
  141 + "status": null,
  142 + "related_products": [],
  143 + "description": null,
  144 + "parent": null,
  145 + "title": "Carlsberg Golf Umbrella (Pack of 1)",
  146 + "date_updated": "2011-02-15 15:53:02",
  147 + "upc": "071216",
  148 + "score": 0.0,
  149 + "date_created": "2011-02-15 15:53:02",
  150 + "product_options": [],
  151 + "slug": "carlsberg-golf-umbrella-pack-of-1",
  152 + "product_class": 1
  153 + }
  154 + },
  155 + {
  156 + "pk": 2,
  157 + "model": "catalogue.product",
  158 + "fields": {
  159 + "status": null,
  160 + "related_products": [],
  161 + "description": null,
  162 + "parent": null,
  163 + "title": "Carlsberg Bunting - 5m (Pack of 2)",
  164 + "date_updated": "2011-02-15 15:53:02",
  165 + "upc": "072174",
  166 + "score": 0.0,
  167 + "date_created": "2011-02-15 15:53:02",
  168 + "product_options": [],
  169 + "slug": "carlsberg-bunting-5m-pack-of-2",
  170 + "product_class": 1
  171 + }
  172 + },
  173 + {
  174 + "pk": 3,
  175 + "model": "catalogue.product",
  176 + "fields": {
  177 + "status": null,
  178 + "related_products": [],
  179 + "description": null,
  180 + "parent": null,
  181 + "title": "Tetley's 22oz Toughened Pint Glass (Pack of 24)",
  182 + "date_updated": "2011-02-15 15:53:02",
  183 + "upc": "072261",
  184 + "score": 0.0,
  185 + "date_created": "2011-02-15 15:53:02",
  186 + "product_options": [],
  187 + "slug": "tetleys-22oz-toughened-pint-glass-pack-of-24",
  188 + "product_class": 1
  189 + }
  190 + },
  191 + {
  192 + "pk": 1,
  193 + "model": "partner.partner",
  194 + "fields": {
  195 + "name": "Prolog",
  196 + "users": []
  197 + }
  198 + },
  199 + {
  200 + "pk": 1,
  201 + "model": "partner.stockrecord",
  202 + "fields": {
  203 + "price_currency": "GBP",
  204 + "product": 1,
  205 + "partner_sku": "071216",
  206 + "price_retail": null,
  207 + "date_updated": "2012-04-13 17:58:31",
  208 + "num_in_stock": 0,
  209 + "num_allocated": 0,
  210 + "low_stock_threshold": null,
  211 + "date_created": "2012-04-13 17:58:31",
  212 + "partner": 1,
  213 + "price_excl_tax": "14",
  214 + "cost_price": null
  215 + }
  216 + },
  217 + {
  218 + "pk": 2,
  219 + "model": "partner.stockrecord",
  220 + "fields": {
  221 + "price_currency": "GBP",
  222 + "product": 2,
  223 + "partner_sku": "072174",
  224 + "price_retail": null,
  225 + "date_updated": "2012-04-13 17:58:31",
  226 + "num_in_stock": 127,
  227 + "num_allocated": 0,
  228 + "low_stock_threshold": null,
  229 + "date_created": "2012-04-13 17:58:31",
  230 + "partner": 1,
  231 + "price_excl_tax": "7.32",
  232 + "cost_price": null
  233 + }
  234 + },
  235 + {
  236 + "pk": 3,
  237 + "model": "partner.stockrecord",
  238 + "fields": {
  239 + "price_currency": "GBP",
  240 + "product": 3,
  241 + "partner_sku": "072261",
  242 + "price_retail": null,
  243 + "date_updated": "2012-04-13 17:58:31",
  244 + "num_in_stock": 662,
  245 + "num_allocated": 0,
  246 + "low_stock_threshold": null,
  247 + "date_created": "2012-04-13 17:58:31",
  248 + "partner": 1,
  249 + "price_excl_tax": "13.82",
  250 + "cost_price": null
  251 + }
  252 + },
  253 + {
  254 + "pk": 4,
  255 + "model": "partner.stockrecord",
  256 + "fields": {
  257 + "price_currency": "GBP",
  258 + "product": 4,
  259 + "partner_sku": "073729",
  260 + "price_retail": null,
  261 + "date_updated": "2012-04-13 17:58:31",
  262 + "num_in_stock": 54,
  263 + "num_allocated": 0,
  264 + "low_stock_threshold": null,
  265 + "date_created": "2012-04-13 17:58:31",
  266 + "partner": 1,
  267 + "price_excl_tax": "8",
  268 + "cost_price": null
  269 + }
  270 + },
  271 + {
  272 + "pk": 5,
  273 + "model": "partner.stockrecord",
  274 + "fields": {
  275 + "price_currency": "GBP",
  276 + "product": 5,
  277 + "partner_sku": "073731",
  278 + "price_retail": null,
  279 + "date_updated": "2012-04-13 17:58:31",
  280 + "num_in_stock": 391,
  281 + "num_allocated": 0,
  282 + "low_stock_threshold": null,
  283 + "date_created": "2012-04-13 17:58:31",
  284 + "partner": 1,
  285 + "price_excl_tax": "8",
  286 + "cost_price": null
  287 + }
  288 + },
  289 + {
  290 + "pk": 6,
  291 + "model": "partner.stockrecord",
  292 + "fields": {
  293 + "price_currency": "GBP",
  294 + "product": 6,
  295 + "partner_sku": "073733",
  296 + "price_retail": null,
  297 + "date_updated": "2012-04-13 17:58:31",
  298 + "num_in_stock": 221,
  299 + "num_allocated": 0,
  300 + "low_stock_threshold": null,
  301 + "date_created": "2012-04-13 17:58:31",
  302 + "partner": 1,
  303 + "price_excl_tax": "8",
  304 + "cost_price": null
  305 + }
  306 + },
  307 + {
  308 + "pk": 7,
  309 + "model": "partner.stockrecord",
  310 + "fields": {
  311 + "price_currency": "GBP",
  312 + "product": 7,
  313 + "partner_sku": "073850",
  314 + "price_retail": null,
  315 + "date_updated": "2012-04-13 17:58:31",
  316 + "num_in_stock": 90,
  317 + "num_allocated": 5,
  318 + "low_stock_threshold": null,
  319 + "date_created": "2012-04-13 17:58:31",
  320 + "partner": 1,
  321 + "price_excl_tax": "13.9",
  322 + "cost_price": null
  323 + }
  324 + },
  325 + {
  326 + "pk": 8,
  327 + "model": "partner.stockrecord",
  328 + "fields": {
  329 + "price_currency": "GBP",
  330 + "product": 8,
  331 + "partner_sku": "073922",
  332 + "price_retail": null,
  333 + "date_updated": "2012-04-13 17:58:31",
  334 + "num_in_stock": 153,
  335 + "num_allocated": 0,
  336 + "low_stock_threshold": null,
  337 + "date_created": "2012-04-13 17:58:31",
  338 + "partner": 1,
  339 + "price_excl_tax": "6.99",
  340 + "cost_price": null
  341 + }
  342 + },
  343 + {
  344 + "pk": 9,
  345 + "model": "partner.stockrecord",
  346 + "fields": {
  347 + "price_currency": "GBP",
  348 + "product": 9,
  349 + "partner_sku": "074127",
  350 + "price_retail": null,
  351 + "date_updated": "2012-04-13 17:58:31",
  352 + "num_in_stock": 654,
  353 + "num_allocated": 0,
  354 + "low_stock_threshold": null,
  355 + "date_created": "2012-04-13 17:58:31",
  356 + "partner": 1,
  357 + "price_excl_tax": "13.76",
  358 + "cost_price": null
  359 + }
  360 + },
  361 + {
  362 + "pk": 10,
  363 + "model": "partner.stockrecord",
  364 + "fields": {
  365 + "price_currency": "GBP",
  366 + "product": 10,
  367 + "partner_sku": "074132",
  368 + "price_retail": null,
  369 + "date_updated": "2012-04-13 17:58:31",
  370 + "num_in_stock": 38,
  371 + "num_allocated": 5,
  372 + "low_stock_threshold": null,
  373 + "date_created": "2012-04-13 17:58:31",
  374 + "partner": 1,
  375 + "price_excl_tax": "16.06",
  376 + "cost_price": null
  377 + }
  378 + }
  379 +]
64 oscar/templates/checkout/checkout.html
@@ -15,34 +15,36 @@
15 15 {% block content %}
16 16
17 17 <div class="row-fluid">
18   - {% block shipping_address %}
19   - <div class="span6">
20   - <div class="sub-header">
21   - <h2>Shipping address</h2>
22   - </div>
23   - <div class="well well-info">
24   - <dl>
25   - <dt>Address</dt>
26   - <dd>
27   - {% for field in shipping_address.active_address_fields %}
28   - {{ field }}<br/>
29   - {% endfor %}
30   - </dd>
31   - {% if shipping_address.phone_number %}
32   - <dt>Contact number</dt>
33   - <dd>{{ shipping_addr.phone_number }}</dd>
34   - {% endif %}
35   - {% if shipping_address.notes %}
36   - <dt>Shipping notes</dt>
37   - <dd>{{ shipping_addr.notes }}</dd>
38   - {% endif %}
39   - </dl>
40   - <div class="alert-actions">
41   - <a href="{% url checkout:shipping-address %}" class="btn">Change shipping address</a>
42   - </div>
43   - </div>
44   - </div>
45   - {% endblock shipping_address %}
  18 + {% block shipping_address %}
  19 + <div class="span6">
  20 + <div class="sub-header">
  21 + <h2>Shipping address</h2>
  22 + </div>
  23 + <div class="well well-info">
  24 + <dl>
  25 + <dt>Address</dt>
  26 + <dd>
  27 + {% for field in shipping_address.active_address_fields %}
  28 + {{ field }}<br/>
  29 + {% endfor %}
  30 + </dd>
  31 + {% if shipping_address.phone_number %}
  32 + <dt>Contact number</dt>
  33 + <dd>{{ shipping_addr.phone_number }}</dd>
  34 + {% endif %}
  35 + {% if shipping_address.notes %}
  36 + <dt>Shipping notes</dt>
  37 + <dd>{{ shipping_addr.notes }}</dd>
  38 + {% endif %}
  39 + </dl>
  40 + {% block shipping_address_actions %}
  41 + <div class="alert-actions">
  42 + <a href="{% url checkout:shipping-address %}" class="btn">Change shipping address</a>
  43 + </div>
  44 + {% endblock %}
  45 + </div>
  46 + </div>
  47 + {% endblock shipping_address %}
46 48
47 49 {% block payment_method %}
48 50 <div class="span6">
@@ -61,8 +63,8 @@
61 63 </dd>
62 64 </dl>
63 65 <div class="alert-actions">
64   - <a href="/checkout/payment-details/" class="btn">Change credit card details</a>
65   - </div>
  66 + <a href="/checkout/payment-details/" class="btn">Change credit card details</a>
  67 + </div>
66 68 </div>
67 69 </div>
68 70 {% endblock payment_method %}
@@ -136,9 +138,11 @@ <h3 class="span11">Order total:</h3>
136 138 <h3 class="span1">{{ order_total_incl_tax|currency }}</h3>
137 139 </div>
138 140 </div>
  141 + {% block order_contents_actions %}
139 142 <div class="form-actions">
140 143 <a href="{% url basket:summary %}" class="btn">Edit order contents</a>
141 144 </div>
  145 + {% endblock %}
142 146 {% endblock order_contents %}
143 147
144 148
2  setup.py
@@ -25,7 +25,7 @@
25 25 packages=find_packages(exclude=["*.tests"]),
26 26 include_package_data = True,
27 27 install_requires=[
28   - 'django==1.3.1',
  28 + 'django>=1.3.1',
29 29 'PIL',
30 30 'South>=0.7.3',
31 31 'django-extra-views>=0.1.0',
2  testing-reqs.txt
@@ -2,7 +2,7 @@ PyZen==0.3.1
2 2 Sphinx==1.1.2
3 3 Werkzeug==0.6.2
4 4 coverage==3.5.1
5   -django-debug-toolbar==0.8.4
  5 +django-debug-toolbar==0.9.4
6 6 django-dynamic-fixture==1.4.2
7 7 django-extensions==0.5
8 8 docutils==0.8.1

No commit comments for this range

Something went wrong with that request. Please try again.