Commits

Bruce Kroeze committed 4992e78

making PROTECTED_DIR configuration only appear if DownloadableProduct is enabled in settings

Comments (0)

Files changed (1)

satchmo/product/config.py

 
 PRODUCT_GROUP = ConfigurationGroup('PRODUCT', _('Product Settings'))
 
-#TODO, add to this list when done
-#    ('product', 'DownloadableProduct'),
-#    ('product', 'BundledProduct'),
-
-config_register([
-
-MultipleStringValue(PRODUCT_GROUP,
+PRODUCT_TYPES = config_register(MultipleStringValue(PRODUCT_GROUP,
     'PRODUCT_TYPES',
     description=_("Product Model Options"),
     default=['product::ConfigurableProduct', 'product::ProductVariation'],
              ('product::ProductVariation', _('Product Variation')),
              ('product::CustomProduct', _('Custom Order')),
              ('product::DownloadableProduct', _('Downloable Product'))]
-    ),
- 
+    ))
+    
+config_register([
+
 StringValue(PRODUCT_GROUP,
     'IMAGE_DIR',
     description=_("Upload Image Dir"),
     help_text=_("""This is only used if you use Downloadable Products.  
 This value will be appended to MEDIA_ROOT.  Do not worry about slashes.  
 We can handle it any which way."""),
-    default="protected"),
+    default="protected",
+    requires=PRODUCT_TYPES,
+    requiresvalue='product::DownloadableProduct'),
     
 ])