add user_user support to atlas collections
This commit is contained in:
+10
-4
@@ -28,6 +28,7 @@ from atlas.models import (
|
||||
Condition,
|
||||
Structure,
|
||||
Subspecialty,
|
||||
UserReportAnswer,
|
||||
)
|
||||
|
||||
from anatomy.models import Modality
|
||||
@@ -440,10 +441,8 @@ SeriesImageFormSet = inlineformset_factory(
|
||||
max_num=2000,
|
||||
)
|
||||
|
||||
|
||||
class CidReportAnswerForm(ModelForm):
|
||||
class BaseReportAnswerForm(ModelForm):
|
||||
class Meta:
|
||||
model = CidReportAnswer
|
||||
fields = ["answer"]
|
||||
|
||||
widgets = {
|
||||
@@ -460,9 +459,16 @@ class CidReportAnswerForm(ModelForm):
|
||||
# }
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
super(CidReportAnswerForm, self).__init__(*args, **kwargs)
|
||||
super(BaseReportAnswerForm, self).__init__(*args, **kwargs)
|
||||
self.fields["answer"].required = False
|
||||
|
||||
class CidReportAnswerForm(BaseReportAnswerForm):
|
||||
class Meta(BaseReportAnswerForm.Meta):
|
||||
model = CidReportAnswer
|
||||
|
||||
class UserReportAnswerForm(BaseReportAnswerForm):
|
||||
class Meta(BaseReportAnswerForm.Meta):
|
||||
model = UserReportAnswer
|
||||
|
||||
class CidReportAnswerMarkForm(ModelForm):
|
||||
class Meta:
|
||||
|
||||
Reference in New Issue
Block a user