Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pre-SAC serialization bugfix #947

Merged
merged 1 commit into from
Apr 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion backend/api/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def eligibility_check(user, data):
next_step = reverse("api-auditee-info")

# Store step 0 data in profile, overwriting any pre-existing.
user.profile.entry_form_data = data
user.profile.entry_form_data = serializer.data
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should store the serialized data instead of the raw data, as the serialized data will have done the appropriate type conversions (e.g. "True" --> True)

user.profile.save()
return {"eligible": True, "next": next_step}

Expand Down
1 change: 0 additions & 1 deletion backend/report_submission/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ class GeneralInformationForm(forms.Form):
auditee_contact_title = forms.CharField()
auditee_phone = forms.CharField()
auditee_email = forms.CharField()
user_provided_organization_type = forms.CharField()
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this field is not actually submitted as part of the general information form, so we're removing it from the expected fields here

auditor_firm_name = forms.CharField()
auditor_ein = forms.CharField()
auditor_ein_not_an_ssn_attestation = forms.BooleanField(required=False)
Expand Down
5 changes: 2 additions & 3 deletions backend/report_submission/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,8 @@ def test_step_one_eligibility_submission_pass(self):
user.refresh_from_db()
saved = user.profile.entry_form_data
self.assertEqual(saved["user_provided_organization_type"], "state")
self.assertEqual(saved["met_spending_threshold"], "True")
self.assertEqual(saved["is_usa_based"], "True")
self.assertEqual(saved["met_spending_threshold"], True)
self.assertEqual(saved["is_usa_based"], True)

def test_step_one_eligibility_submission_fail(self):
"""
Expand Down Expand Up @@ -445,7 +445,6 @@ def test_post_updates_fields(self):
"auditee_contact_title": "Lord of Windows",
"auditee_phone": "5558675310",
"auditee_email": "auditee.mcaudited.again@leftfield.com",
"user_provided_organization_type": "state",
"auditor_firm_name": "Penny Audit Store",
"auditor_ein": "123456780",
"auditor_ein_not_an_ssn_attestation": True,
Expand Down