1. Chris Moffitt
  2. satchmo


Bruce Kroeze  committed 4992e78

making PROTECTED_DIR configuration only appear if DownloadableProduct is enabled in settings

  • Participants
  • Parent commits d5bf7b6
  • Branches default

Comments (0)

Files changed (1)

File satchmo/product/config.py

View file
 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'),