Skip to content

Commit 9d5ed12

Browse files
Fix (#839) Signs and Symptoms and Vital Signs forms unavailable with
Auditor/read-only role
1 parent f70d6fe commit 9d5ed12

File tree

3 files changed

+11
-5
lines changed

3 files changed

+11
-5
lines changed

CHANGES

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,11 @@ Changes
33

44
unreleased
55
------
6-
- fixes issues where addition of some unscheduled visits could result in
6+
- fix issues where addition of some unscheduled visits could result in
77
a server error when trying to render subject's dashboard
88
(#798, #807, #824, #827, #829, #830, #831)
9+
- fix Signs and Symptoms and Vital Signs forms unavailable with
10+
Auditor/read-only role (#839)
911
- update use of format_html for DJ6
1012
- remove all references in templates to `bootstrap3` folders
1113
- bump to edc-csf 1.0.0

effect_subject/forms/signs_and_symptoms_form.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,10 @@ class SignsAndSymptomsForm(CrfModelFormMixin, ActionItemFormMixin, forms.ModelFo
2020

2121
def __init__(self, *args, **kwargs):
2222
super().__init__(*args, **kwargs)
23-
self.fields["current_sx"].queryset = SiSx.objects.order_by("display_index")
24-
self.fields["current_sx_gte_g3"].queryset = SiSx.objects.order_by("display_index")
23+
if self.fields.get("current_sx"):
24+
self.fields["current_sx"].queryset = SiSx.objects.order_by("display_index")
25+
if self.fields.get("current_sx_gte_g3"):
26+
self.fields["current_sx_gte_g3"].queryset = SiSx.objects.order_by("display_index")
2527

2628
class Meta:
2729
model = SignsAndSymptoms

effect_subject/forms/vital_signs_form.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,10 @@ class VitalSignsForm(CrfModelFormMixin, ActionItemCrfFormMixin, forms.ModelForm)
1212

1313
def __init__(self, *args, **kwargs):
1414
super().__init__(*args, **kwargs)
15-
self.fields["reportable_as_ae"].choices = YES_NO
16-
self.fields["patient_admitted"].choices = YES_NO
15+
if self.fields.get("reportable_as_ae"):
16+
self.fields["reportable_as_ae"].choices = YES_NO
17+
if self.fields.get("patient_admitted"):
18+
self.fields["patient_admitted"].choices = YES_NO
1719

1820
class Meta(ActionItemCrfFormMixin.Meta):
1921
model = VitalSigns

0 commit comments

Comments
 (0)