Prevent duplicate form media loading..

..by setting BaseCaseStudyForm.helper.include_media = False
This commit is contained in:
Carl van Tonder 2018-04-19 15:14:54 -04:00
parent f8695fae3c
commit 7436fa7e2e

View File

@ -27,6 +27,7 @@ class BaseCaseStudyForm(forms.models.ModelForm):
self.helper.form_action = 'add'
self.helper.label_class = 'col-lg-2'
self.helper.field_class = 'col-lg-8'
self.helper.include_media = False
class Meta:
model = CaseStudy
@ -126,7 +127,7 @@ class LongCaseStudyForm(BaseCaseStudyForm):
POSITIVE_CASE_TYPE_CHOICES = [
(choice[0], mark_safe('<b>%s</b><br><span class="text-muted">%s</span>' % (choice[1], self.POSITIVE_CASE_TYPE_HELP[choice[0]])))
for choice in CaseStudy.POSITIVE_CASE_TYPE_CHOICES
for choice in CaseStudy.POSITIVE_CASE_TYPE_CHOICES
]
self.fields['positive_case_type'] = forms.ChoiceField(