From 32e7e5e21a7580ecbad63ff746ae572fa7c83860 Mon Sep 17 00:00:00 2001 From: Tobias Bengfort Date: Tue, 15 Sep 2020 15:37:59 +0200 Subject: [PATCH 1/8] add change_appointment to recruiter and study conductor --- castellum/castellum_auth/fixtures/groups.json | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/castellum/castellum_auth/fixtures/groups.json b/castellum/castellum_auth/fixtures/groups.json index bbbe6e544..0760eefac 100644 --- a/castellum/castellum_auth/fixtures/groups.json +++ b/castellum/castellum_auth/fixtures/groups.json @@ -52,6 +52,11 @@ "recruit", "recruitment", "participation" + ], + [ + "change_appointment", + "recruitment", + "appointment" ] ] } @@ -66,6 +71,11 @@ "conduct_study", "recruitment", "participation" + ], + [ + "change_appointment", + "recruitment", + "appointment" ] ] } -- GitLab From 142628c191423a11d56ccf106c2c4eb179e1efed Mon Sep 17 00:00:00 2001 From: Tobias Bengfort Date: Tue, 15 Sep 2020 15:43:06 +0200 Subject: [PATCH 2/8] Gardening --- castellum/execution/templates/execution/participation_base.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/castellum/execution/templates/execution/participation_base.html b/castellum/execution/templates/execution/participation_base.html index 5b86d58dd..1ba76987b 100644 --- a/castellum/execution/templates/execution/participation_base.html +++ b/castellum/execution/templates/execution/participation_base.html @@ -1,5 +1,5 @@ {% extends "execution/base.html" %} -{% load i18n auth %} +{% load i18n %} {% block title %}{{ study }} · {{ block.super }}{% endblock %} -- GitLab From 84d94a3b3169449bf91e480a5d82f824b5eb6f19 Mon Sep 17 00:00:00 2001 From: Tobias Bengfort Date: Tue, 15 Sep 2020 15:44:26 +0200 Subject: [PATCH 3/8] check change_appointment in recruitment --- castellum/recruitment/forms.py | 6 ++- .../templates/recruitment/contact.html | 44 ++++++++++--------- castellum/recruitment/views.py | 11 ++++- tests/recruitment/views/test_contact_view.py | 35 +++++++++++++++ 4 files changed, 73 insertions(+), 23 deletions(-) diff --git a/castellum/recruitment/forms.py b/castellum/recruitment/forms.py index 5f20df567..2918ecbdc 100644 --- a/castellum/recruitment/forms.py +++ b/castellum/recruitment/forms.py @@ -267,7 +267,7 @@ class AppointmentsForm(forms.ModelForm): yield self[name] -class ContactForm(AppointmentsForm): +class ContactForm(forms.ModelForm): class Meta: model = Participation fields = ['status', 'followup_date', 'followup_time', 'exclusion_criteria_checked'] @@ -290,6 +290,10 @@ class ContactForm(AppointmentsForm): self.fields['status'].widget.disabled_choices = [Participation.INVITED] +class ContactAndAppointmentsForm(ContactForm, AppointmentsForm): + pass + + class SendMailForm(forms.Form): batch_size = forms.IntegerField( min_value=1, label=_('How many subjects do you want to contact?') diff --git a/castellum/recruitment/templates/recruitment/contact.html b/castellum/recruitment/templates/recruitment/contact.html index 6d06ce8ef..ac8c55204 100644 --- a/castellum/recruitment/templates/recruitment/contact.html +++ b/castellum/recruitment/templates/recruitment/contact.html @@ -36,6 +36,8 @@ {% endif %} + {% has_perm 'recruitment.change_appointment' user study as can_change_appointment %} +