.
This commit is contained in:
+2
-13
@@ -7,6 +7,7 @@ from django.forms import (
|
||||
CharField,
|
||||
)
|
||||
from django.forms import inlineformset_factory
|
||||
from generic.forms import ExamFormMixin
|
||||
|
||||
from rapids.models import (
|
||||
Abnormality,
|
||||
@@ -227,7 +228,7 @@ AnswerUpdateFormSet = inlineformset_factory(
|
||||
|
||||
|
||||
# This should be made generic?
|
||||
class ExamForm(ModelForm):
|
||||
class ExamForm(ExamFormMixin, ModelForm):
|
||||
class Meta:
|
||||
model = Exam
|
||||
fields = [
|
||||
@@ -243,15 +244,3 @@ class ExamForm(ModelForm):
|
||||
"cid_user_groups",
|
||||
"author",
|
||||
]
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
ModelForm.__init__(self, *args, **kwargs)
|
||||
super(ExamForm, self).__init__(*args, **kwargs)
|
||||
|
||||
def save(self, commit=True):
|
||||
instance = ModelForm.save(self, False)
|
||||
instance.save()
|
||||
|
||||
self.save_m2m()
|
||||
|
||||
return instance
|
||||
Reference in New Issue
Block a user