From c20419fd93da80a3fb22d373936cc0d79b1d3aab Mon Sep 17 00:00:00 2001 From: Michael Volo Date: Thu, 6 Mar 2025 16:13:28 -0600 Subject: [PATCH 1/2] update school field name --- donations/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/donations/views.py b/donations/views.py index b23847a18..4055eb860 100644 --- a/donations/views.py +++ b/donations/views.py @@ -14,7 +14,7 @@ def post(self, request): thank_you_note = request.data['thank_you_note'] first_name = request.data['first_name'] last_name = request.data['last_name'] - institution = request.data['institution'] + institution = request.data['school'] consent_to_share_or_contact = request.data.get('consent_to_share_or_contact', False) contact_email_address = request.data.get('contact_email_address', '') source = request.data.get('source', '') From 3d3bbbfa0997f64b5fcfa5034f23996d380af305 Mon Sep 17 00:00:00 2001 From: Michael Volo Date: Thu, 6 Mar 2025 16:21:39 -0600 Subject: [PATCH 2/2] update tests --- donations/tests.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/donations/tests.py b/donations/tests.py index e3569392d..943f1a812 100644 --- a/donations/tests.py +++ b/donations/tests.py @@ -37,7 +37,7 @@ def test_donation_api_get(self): class ThankYouNoteTest(APITestCase, TestCase): def test_thank_you_note_api_post(self): - data = {"thank_you_note":"OpenStax is the best! Loved not paying for a book", "last_name": "Drew", "first_name": "Jessica", "institution": "Rice University", "consent_to_share_or_contact": "True", "contact_email_address": "jess@example.com", "source": "PDF download"} + data = {"thank_you_note":"OpenStax is the best! Loved not paying for a book", "last_name": "Drew", "first_name": "Jessica", "school": "Rice University", "consent_to_share_or_contact": "True", "contact_email_address": "jess@example.com", "source": "PDF download"} response = self.client.post('/apps/cms/api/donations/thankyounote/', data, format='json') self.assertEqual(response.status_code, status.HTTP_201_CREATED) tyn = ThankYouNote.objects.filter(last_name='Drew').values()