diff options
Diffstat (limited to 'servo')
-rw-r--r-- | servo/migrations/0026_auto_20150826_1323.py | 19 | ||||
-rw-r--r-- | servo/migrations/0027_remove_location_logo.py | 18 | ||||
-rw-r--r-- | servo/models/common.py | 7 | ||||
-rw-r--r-- | servo/models/product.py | 10 | ||||
-rwxr-xr-x | servo/templates/orders/print_confirmation.html | 2 |
5 files changed, 45 insertions, 11 deletions
diff --git a/servo/migrations/0026_auto_20150826_1323.py b/servo/migrations/0026_auto_20150826_1323.py new file mode 100644 index 0000000..fbad85d --- /dev/null +++ b/servo/migrations/0026_auto_20150826_1323.py @@ -0,0 +1,19 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import models, migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('servo', '0025_auto_20150815_0921'), + ] + + operations = [ + migrations.AlterField( + model_name='productcategory', + name='title', + field=models.CharField(default='New Category', unique=True, max_length=255), + ), + ] diff --git a/servo/migrations/0027_remove_location_logo.py b/servo/migrations/0027_remove_location_logo.py new file mode 100644 index 0000000..8ca227c --- /dev/null +++ b/servo/migrations/0027_remove_location_logo.py @@ -0,0 +1,18 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import models, migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('servo', '0026_auto_20150826_1323'), + ] + + operations = [ + migrations.RemoveField( + model_name='location', + name='logo', + ), + ] diff --git a/servo/models/common.py b/servo/models/common.py index 76d9ffd..df23a86 100644 --- a/servo/models/common.py +++ b/servo/models/common.py @@ -476,13 +476,6 @@ class Location(models.Model): help_text=_('Will be shown on print templates') ) - logo = models.FileField( - null=True, - blank=True, - upload_to='logos', - verbose_name=_('Logo') - ) - enabled = models.BooleanField( default=True, verbose_name=_('Enabled') 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', diff --git a/servo/templates/orders/print_confirmation.html b/servo/templates/orders/print_confirmation.html index 0b0ca77..7584ec9 100755 --- a/servo/templates/orders/print_confirmation.html +++ b/servo/templates/orders/print_confirmation.html @@ -8,7 +8,7 @@ {% with order.location as location %} <div class="row"> <div class="span4"> - {% if location.logo %} + {% if conf.company_logo %} <img src="{% get_media_prefix %}{{ conf.company_logo }}" alt="logo" title="logo" class="media-object pull-left span2" style="margin:10px"/> {% endif %} </div> |