diff --git a/castellum/contacts/templates/contacts/__contact_detail.html b/castellum/contacts/templates/contacts/__contact_detail.html
index 3e9b37236d28f91c0c29236d251593586b2cc118..54905f445cf6e1791775b922ab273feaf7783b77 100644
--- a/castellum/contacts/templates/contacts/__contact_detail.html
+++ b/castellum/contacts/templates/contacts/__contact_detail.html
@@ -37,24 +37,4 @@
{% endblocktranslate %}
{% endif %}
-
-
{% translate "General contact notes" %}
-
- {% if contact.subject.note_hard_of_hearing or contact.subject.note_difficult_to_understand or contact.subject.note_abusive_language or contact.subject.subjectnote_set.exists %}
- {% if contact.subject.note_hard_of_hearing %}
- {{ contact.subject|verbose_name:'note_hard_of_hearing' }}
- {% endif %}
- {% if contact.subject.note_difficult_to_understand %}
- {{ contact.subject|verbose_name:'note_difficult_to_understand' }}
- {% endif %}
- {% if contact.subject.note_abusive_language %}
- {{ contact.subject|verbose_name:'note_abusive_language' }}
- {% endif %}
- {% for note in contact.subject.subjectnote_set.all %}
- {{ note.content }}
- {% endfor %}
- {% else %}
- —
- {% endif %}
-
diff --git a/castellum/subjects/forms.py b/castellum/subjects/forms.py
index 08769deaf69e8c04a38f725bb8e157b55763fa28..484aa259ba7a9f467f3a82dae5a124ffd5eb7820 100644
--- a/castellum/subjects/forms.py
+++ b/castellum/subjects/forms.py
@@ -176,9 +176,6 @@ class AdditionalInfoForm(forms.ModelForm):
model = Subject
fields = [
'deceased',
- 'note_hard_of_hearing',
- 'note_difficult_to_understand',
- 'note_abusive_language',
'availability_monday',
'availability_tuesday',
'availability_wednesday',
diff --git a/castellum/subjects/migrations/0022_rm_notes.py b/castellum/subjects/migrations/0022_rm_notes.py
new file mode 100644
index 0000000000000000000000000000000000000000..d912568325b272a325793b384c6a77442bfe089c
--- /dev/null
+++ b/castellum/subjects/migrations/0022_rm_notes.py
@@ -0,0 +1,28 @@
+# Generated by Django 3.1.3 on 2020-11-17 11:35
+
+from django.db import migrations
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('subjects', '0021_merge_attributeset'),
+ ]
+
+ operations = [
+ migrations.RemoveField(
+ model_name='subject',
+ name='note_abusive_language',
+ ),
+ migrations.RemoveField(
+ model_name='subject',
+ name='note_difficult_to_understand',
+ ),
+ migrations.RemoveField(
+ model_name='subject',
+ name='note_hard_of_hearing',
+ ),
+ migrations.DeleteModel(
+ name='SubjectNote',
+ ),
+ ]
diff --git a/castellum/subjects/mixins.py b/castellum/subjects/mixins.py
index 02427b6cff3885261f810819999d0414979d3d7a..86e0ac54112588e24669a1e55754c0ddf88d01ad 100644
--- a/castellum/subjects/mixins.py
+++ b/castellum/subjects/mixins.py
@@ -19,7 +19,6 @@
# License along with Castellum. If not, see
# .
-from django import forms
from django.conf import settings
from django.core.exceptions import PermissionDenied
from django.urls import reverse
@@ -32,7 +31,6 @@ from castellum.utils.mail import MailContext
from .forms import AdditionalInfoForm
from .forms import DataProtectionForm
from .models import Subject
-from .models import SubjectNote
class SubjectMixin:
@@ -114,47 +112,3 @@ class BaseAdditionalInfoUpdateView(PermissionRequiredMixin, UpdateView):
form_class = AdditionalInfoForm
permission_required = 'subjects.change_subject'
template_name = 'subjects/subject_additional_info_form.html'
-
- def get_notes_form(self):
- form_class = forms.modelform_factory(SubjectNote, fields=['content'])
- return form_class(prefix='{prefix}')
-
- def get_notes_formset(self):
- formset_class = forms.modelformset_factory(
- SubjectNote, fields=['content'], extra=0, can_delete=True
- )
- kwargs = self.get_form_kwargs()
- kwargs.pop('instance')
- kwargs.pop('initial')
- return formset_class(queryset=SubjectNote.objects.filter(subject=self.object), **kwargs)
-
- def get_context_data(self, **kwargs):
- context = super().get_context_data(**kwargs)
- if 'notes_formset' not in context:
- context['notes_formset'] = self.get_notes_formset()
- context['template_form'] = self.get_notes_form()
- return context
-
- def post(self, request, *args, **kwargs):
- self.object = self.get_object()
- form = self.get_form()
- notes_formset = self.get_notes_formset()
-
- if form.is_valid() and notes_formset.is_valid():
- return self.form_valid(form, notes_formset)
- else:
- return self.form_invalid(form, notes_formset)
-
- def form_invalid(self, form, notes_formset):
- return self.render_to_response(
- self.get_context_data(form=form, notes_formset=notes_formset)
- )
-
- def form_valid(self, form, notes_formset):
- response = super().form_valid(form)
-
- for subform in notes_formset:
- subform.instance.subject = self.object
- notes_formset.save()
-
- return response
diff --git a/castellum/subjects/models.py b/castellum/subjects/models.py
index 058a526ded30eadbebcd0b547840d3843828467a..e4951feea8bd5a54d4bf1664277b424fdb06bab3 100644
--- a/castellum/subjects/models.py
+++ b/castellum/subjects/models.py
@@ -117,10 +117,6 @@ class Subject(TimeStampedModel):
source = models.CharField(_('Data source'), max_length=128, blank=True)
- note_hard_of_hearing = models.BooleanField(_('Hard of hearing'), default=False)
- note_difficult_to_understand = models.BooleanField(_('Difficult to understand'), default=False)
- note_abusive_language = models.BooleanField(_('Abusive language'), default=False)
-
additional_suitability_document = models.ManyToManyField(
StudyType,
verbose_name=_('Additional suitability document for study type'),
@@ -170,9 +166,6 @@ class Subject(TimeStampedModel):
'availability_thursday',
'availability_friday',
'not_available_until',
- 'note_hard_of_hearing',
- 'note_difficult_to_understand',
- 'note_abusive_language',
'source',
'to_be_deleted',
'export_requested',
@@ -309,11 +302,6 @@ class Subject(TimeStampedModel):
return completed, total
-class SubjectNote(models.Model):
- subject = models.ForeignKey(Subject, on_delete=models.CASCADE)
- content = models.CharField(_('Content'), max_length=128, blank=True)
-
-
class ConsentDocument(models.Model):
created_at = models.DateTimeField(_('Created at'), auto_now_add=True)
is_valid = models.BooleanField(_('Is valid'), default=True)
diff --git a/castellum/subjects/static/js/notes.js b/castellum/subjects/static/js/notes.js
deleted file mode 100644
index 7d554480e0b4622d70fe8daec5b1e66eff81b1aa..0000000000000000000000000000000000000000
--- a/castellum/subjects/static/js/notes.js
+++ /dev/null
@@ -1,18 +0,0 @@
-(function() {
- var totalForms = document.getElementById('id_form-TOTAL_FORMS');
- var notesContainer = document.getElementById('notes-container');
-
- $$.on(document, 'click', '[data-js="note-add"]', function() {
- var template = document.getElementById('note-data-template');
- var wrapper = document.createElement('div');
- wrapper.innerHTML = template.innerHTML.replace(/{prefix}/g, 'form-' + totalForms.value);
- notesContainer.append(wrapper.children[0]);
- totalForms.value = parseInt(totalForms.value, 10) + 1;
- $$.trigger(totalForms, 'change');
- });
-
- $$.on(document, 'click', '[data-js="note-delete"]', function() {
- var target = document.getElementById(this.id.slice(0, -6));
- target.value = this.checked ? '' : 'on';
- });
-})();
diff --git a/castellum/subjects/templates/subjects/subject_additional_info_form.html b/castellum/subjects/templates/subjects/subject_additional_info_form.html
index b55bc9226646f89e6528c001010f748236bbc7c6..8fd367dd8801cc07cee3a57e288d787c1db5c53c 100644
--- a/castellum/subjects/templates/subjects/subject_additional_info_form.html
+++ b/castellum/subjects/templates/subjects/subject_additional_info_form.html
@@ -12,18 +12,6 @@
{% endif %}
-
-
-
-