aboutsummaryrefslogtreecommitdiffstats
path: root/servo/models/product.py
diff options
context:
space:
mode:
authorFilipp Lepalaan <filipp@mac.com>2015-09-03 11:01:19 +0300
committerFilipp Lepalaan <filipp@mac.com>2015-09-03 11:01:19 +0300
commitb3e3941e811b23cc681945da1b1e26c818f9ace4 (patch)
treec53ce9d51e220c066b78f149a6fed0e3a1b060cc /servo/models/product.py
parentabe994c0c2b73f1670496e6687aae19b5bb9eb79 (diff)
downloadServo-b3e3941e811b23cc681945da1b1e26c818f9ace4.tar.gz
Servo-b3e3941e811b23cc681945da1b1e26c818f9ace4.tar.bz2
Servo-b3e3941e811b23cc681945da1b1e26c818f9ace4.zip
Removed location logos
Diffstat (limited to 'servo/models/product.py')
-rw-r--r--servo/models/product.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/servo/models/product.py b/servo/models/product.py
index b3bd787..f7cd418 100644
--- a/servo/models/product.py
+++ b/servo/models/product.py
@@ -429,7 +429,7 @@ class Product(AbstractBaseProduct):
product.labour_tier = part.laborTier
product.part_type = part.partType.upper()
- # eee and componentCode are sometimes missing
+ # EEE and componentCode are sometimes missing
if part.eeeCode:
product.eee_code = str(part.eeeCode).strip()
if part.componentCode:
@@ -542,7 +542,7 @@ class Product(AbstractBaseProduct):
result = part.fetch_image()
filename = basename(result)
self.photo.save(filename, File(open(result)))
- except Exception, e:
+ except Exception as e:
print e
def __unicode__(self):
@@ -564,7 +564,11 @@ class ProductCategory(MPTTModel):
default=defaults.site_id
)
- title = models.CharField(max_length=255, default=_("New Category"))
+ title = models.CharField(
+ max_length=255,
+ unique=True,
+ default=_("New Category")
+ )
slug = models.SlugField(null=True, editable=False)
parent = TreeForeignKey(
'self',