Skip to content

Commit

Permalink
Merge pull request #3198 from GSA-TTS/main
Browse files Browse the repository at this point in the history
  • Loading branch information
jadudm authored Jan 13, 2024
2 parents 52f4209 + 577fd96 commit fa11c9d
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 4 deletions.
2 changes: 1 addition & 1 deletion backend/audit/models/access.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion backend/audit/views/manage_submission_access.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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."""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit fa11c9d

Please sign in to comment.