Skip to content
Snippets Groups Projects
Commit 2762a611 authored by McKenzie Welter's avatar McKenzie Welter
Browse files

allow site and mode to be nullable in admin form

parent 545c86a0
No related branches found
No related tags found
No related merge requests found
......@@ -65,6 +65,18 @@ class CourseEntitlementSupportDetailAdmin(admin.ModelAdmin):
form = CourseEntitlementSupportDetailForm
class CourseEntitlementPolicyForm(forms.ModelForm):
""" Form for creating custom course entitlement policies. """
def __init__(self, *args, **kwargs):
super(CourseEntitlementPolicyForm, self).__init__(*args, **kwargs)
self.fields['site'].required = False
self.fields['mode'].required = False
class Meta:
fields = '__all__'
model = CourseEntitlementPolicy
@admin.register(CourseEntitlementPolicy)
class CourseEntitlementPolicyAdmin(admin.ModelAdmin):
"""
......@@ -75,3 +87,4 @@ class CourseEntitlementPolicyAdmin(admin.ModelAdmin):
'regain_period',
'mode',
'site')
form = CourseEntitlementPolicyForm
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment