add discount percentage configuration
This commit is contained in:
@@ -10,7 +10,7 @@ from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from openedx.core.djangoapps.config_model_utils.admin import StackedConfigModelAdmin
|
||||
|
||||
from .models import DiscountRestrictionConfig
|
||||
from .models import DiscountPercentageConfig, DiscountRestrictionConfig
|
||||
|
||||
|
||||
class DiscountRestrictionConfigAdmin(StackedConfigModelAdmin):
|
||||
@@ -43,3 +43,26 @@ class DiscountRestrictionConfigAdmin(StackedConfigModelAdmin):
|
||||
raw_id_fields = ('course',)
|
||||
|
||||
admin.site.register(DiscountRestrictionConfig, DiscountRestrictionConfigAdmin)
|
||||
|
||||
|
||||
class DiscountPercentageConfigAdmin(StackedConfigModelAdmin):
|
||||
"""
|
||||
Admin to configure discount percentage
|
||||
"""
|
||||
fieldsets = (
|
||||
('Context', {
|
||||
'fields': DiscountRestrictionConfig.KEY_FIELDS,
|
||||
'description': _(
|
||||
'These define the context to configure the percentage for the first purchase discount.'
|
||||
'If multiple contexts apply to a course (for example, if configuration '
|
||||
'is specified for the course specifically, and for the org that the course '
|
||||
'is in, then the more specific context overrides the more general context.'
|
||||
),
|
||||
}),
|
||||
('Configuration', {
|
||||
'fields': ('percentage',),
|
||||
})
|
||||
)
|
||||
raw_id_fields = ('course',)
|
||||
|
||||
admin.site.register(DiscountPercentageConfig, DiscountPercentageConfigAdmin)
|
||||
|
||||
Reference in New Issue
Block a user