Bruce Kroeze committed 4992e78

making PROTECTED_DIR configuration only appear if DownloadableProduct is enabled in settings

Comments (0)

Files changed (1)


 PRODUCT_GROUP = ConfigurationGroup('PRODUCT', _('Product Settings'))
-#TODO, add to this list when done
-#    ('product', 'DownloadableProduct'),
-#    ('product', 'BundledProduct'),
+PRODUCT_TYPES = config_register(MultipleStringValue(PRODUCT_GROUP,
     description=_("Product Model Options"),
     default=['product::ConfigurableProduct', 'product::ProductVariation'],
              ('product::ProductVariation', _('Product Variation')),
              ('product::CustomProduct', _('Custom Order')),
              ('product::DownloadableProduct', _('Downloable Product'))]
-    ),
+    ))
     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'),