diff --git a/backend/audit/models/access.py b/backend/audit/models/access.py index 4527c4b913..2ed076f37e 100644 --- a/backend/audit/models/access.py +++ b/backend/audit/models/access.py @@ -32,7 +32,7 @@ def create(self, **obj_data): # try to pair this Access with an actual User object if we have one for this email address if obj_data["email"]: try: - acc_user = User.objects.get(email=obj_data["email"]) + acc_user = User.objects.get(email__iexact=obj_data["email"]) # if we don't have a User for this email, leave it as None (unclaimed Access) except User.DoesNotExist: acc_user = None diff --git a/backend/audit/views/manage_submission_access.py b/backend/audit/views/manage_submission_access.py index efbc455c65..397b8c9c3e 100644 --- a/backend/audit/views/manage_submission_access.py +++ b/backend/audit/views/manage_submission_access.py @@ -19,7 +19,7 @@ def _get_friendly_role(role): def _create_and_save_access(sac, role, fullname, email): - Access(sac=sac, role=role, fullname=fullname, email=email).save() + Access.objects.create(sac=sac, role=role, fullname=fullname, email=email) class ChangeAccessForm(forms.Form): diff --git a/backend/census_historical_migration/test_notes_to_sefa_xforms.py b/backend/census_historical_migration/test_notes_to_sefa_xforms.py index be8ef83aea..4e85bd03ed 100644 --- a/backend/census_historical_migration/test_notes_to_sefa_xforms.py +++ b/backend/census_historical_migration/test_notes_to_sefa_xforms.py @@ -69,6 +69,12 @@ def test_rate_not_used(self): ), "N", ) + self.assertEqual( + xform_is_minimis_rate_used( + "There are no additional indirect costs allocated to the Corporation." + ), + "N", + ) def test_rate_with_multiple_spaces(self): """Test that the function returns the correct results when the rate is used and there are multiple spaces between words.""" diff --git a/backend/census_historical_migration/workbooklib/notes_to_sefa.py b/backend/census_historical_migration/workbooklib/notes_to_sefa.py index 43ec5b837d..b360514083 100644 --- a/backend/census_historical_migration/workbooklib/notes_to_sefa.py +++ b/backend/census_historical_migration/workbooklib/notes_to_sefa.py @@ -67,13 +67,17 @@ def xform_is_minimis_rate_used(rate_content): r"not\s+opt\s+to\s+use", r"not\s+us(e|ed)", r"not\s+elec(t|ted)", - r"has\s+not\s+charged.*not\s+applicable", + r"not\s+applicable", r"has\s+elected\s+not", r"did\s+not\s+charge\s+indirect\s+costs", r"did\s+not\s+make\s+an\s+election", r"not\s+eligible\s+to\s+use", - r"made\s+no\s+inderect\s+cost\s+rate\s+election", r"rather\s+than\s+the\s+10%", + r"no\s+additional\s+indirect\s+costs", + r"(rate|costs)\s+does\s+not\s+apply", + r"not\s+based\s+on\s+eligible\s+costs", + r"no\s+indirect\s+costs?", + r"not\s+utilized\s+the\s+10%", ] # Patterns that indicate the de minimis rate WAS used @@ -84,6 +88,7 @@ def xform_is_minimis_rate_used(rate_content): r"has\s+adopted", r"elected\s+to", r"is\s+subject\s+to\s+the\s+10-percent", + r"utilized\s+the\s+10%", ] # Check for each pattern in the respective lists