浏览代码

sandbox: allow running make build_sandbox multiple times

master
Michael van Tellingen 9 年前
父节点
当前提交
bf1c6f18b2
没有帐户链接到提交者的电子邮件
共有 2 个文件被更改,包括 2 次插入2 次删除
  1. 1
    1
      Makefile
  2. 1
    1
      src/oscar/apps/partner/importers.py

+ 1
- 1
Makefile 查看文件

@@ -17,7 +17,7 @@ build_sandbox:
17 17
 	sites/sandbox/manage.py loaddata sites/sandbox/fixtures/child_products.json
18 18
 	sites/sandbox/manage.py oscar_import_catalogue sites/sandbox/fixtures/*.csv
19 19
 	sites/sandbox/manage.py oscar_import_catalogue_images sites/sandbox/fixtures/images.tar.gz
20
-	sites/sandbox/manage.py oscar_populate_countries
20
+	sites/sandbox/manage.py oscar_populate_countries --initial-only
21 21
 	sites/sandbox/manage.py loaddata sites/_fixtures/pages.json sites/_fixtures/auth.json sites/_fixtures/ranges.json sites/_fixtures/offers.json
22 22
 	sites/sandbox/manage.py loaddata sites/sandbox/fixtures/orders.json
23 23
 	sites/sandbox/manage.py clear_index --noinput

+ 1
- 1
src/oscar/apps/partner/importers.py 查看文件

@@ -95,7 +95,7 @@ class CatalogueImporter(object):
95 95
 
96 96
         # Category
97 97
         cat = create_from_breadcrumbs(category_str)
98
-        ProductCategory.objects.create(product=item, category=cat)
98
+        ProductCategory.objects.update_or_create(product=item, category=cat)
99 99
 
100 100
         return item
101 101
 

正在加载...
取消
保存