diff --git a/crc/models/email.py b/crc/models/email.py index cf2bb543..96d3227b 100644 --- a/crc/models/email.py +++ b/crc/models/email.py @@ -26,5 +26,5 @@ class EmailModelSchema(ma.Schema): class Meta: model = EmailModel - fields = ["id", "subject", "sender", "recipients", "cc", "bcc", "content", "content_html", + fields = ["id", "subject", "sender", "recipients", "cc", "bcc", "content", "study_id", "timestamp", "workflow_spec_id"] diff --git a/tests/emails/test_email_script.py b/tests/emails/test_email_script.py index 0cb1d558..216bf58e 100644 --- a/tests/emails/test_email_script.py +++ b/tests/emails/test_email_script.py @@ -51,6 +51,9 @@ class TestEmailScript(BaseTest): # Make sure timestamp is UTC self.assertEqual(db_emails[0].timestamp.tzinfo, datetime.timezone.utc) + # Make sure we remove content_html from the returned email_model + self.assertNotIn('content_html', workflow_api.next_task.data['email_model']) + @patch('crc.services.email_service.EmailService.add_email') def test_email_raises_exception(self, mock_response): self.load_example_data() diff --git a/tests/scripts/test_get_email_data.py b/tests/scripts/test_get_email_data.py index b3b648d6..8b847b90 100644 --- a/tests/scripts/test_get_email_data.py +++ b/tests/scripts/test_get_email_data.py @@ -32,6 +32,8 @@ class TestGetEmailData(BaseTest): self.assertEqual('My Email Subject', email_data[0]['subject']) self.assertEqual('sender@example.com', email_data[0]['sender']) self.assertEqual('[\'joe@example.com\']', email_data[0]['recipients']) + # Make sure we remove content_html from email_data + self.assertNotIn('content_html', email_data[0]) def test_get_email_data_by_workflow_spec_id(self): self.load_example_data()