Skip to content

Commit

Permalink
Merge pull request #2321 from GSA-TTS/main
Browse files Browse the repository at this point in the history
  • Loading branch information
jadudm authored Sep 29, 2023
2 parents 6bf96a7 + f639e0d commit 7ae174f
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion backend/audit/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@


class SACAdmin(admin.ModelAdmin):
list_display = ("id",)
list_display = ("id", "report_id")


class AccessAdmin(admin.ModelAdmin):
Expand Down
1 change: 1 addition & 0 deletions backend/cypress/support/general-info.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export function testValidGeneralInfo() {
cy.get('label[for=audit-period-annual]').click();

// Auditee information
cy.get('#auditee_name').type('Super Important name')
cy.get('#ein').type('546000173');
cy.get('label[for=ein_not_an_ssn_attestation]').click();
cy.get('label[for=multiple-eins-yes]').click();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ <h2>
<label for="auditee_name" hidden>Auditee name</label>
<input class="usa-input"
id="auditee_name"
name="auditee_name"
disabled="true"
hidden />
</div>
Expand Down
1 change: 0 additions & 1 deletion backend/report_submission/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,6 @@ def test_end_to_end_submission_pass(self, mock_get_uei_info):
self.assertTemplateUsed(step2_get, "report_submission/step-2.html")

step2_data = {
"auditee_name": "Federal Bureau of Control",
"auditee_uei": "KZV2XNZZN3A8",
"auditee_fiscal_period_start": "01/01/2022",
"auditee_fiscal_period_end": "01/01/2023",
Expand Down
1 change: 0 additions & 1 deletion backend/report_submission/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ def post(self, request):
formatted_post = {
"csrfmiddlewaretoken": request.POST.get("csrfmiddlewaretoken"),
"auditee_uei": form.cleaned_data["auditee_uei"],
"auditee_name": request.POST.get("auditee_name"),
"auditee_address_line_1": request.POST.get("auditee_address_line_1"),
"auditee_city": request.POST.get("auditee_city"),
"auditee_state": request.POST.get("auditee_state"),
Expand Down
13 changes: 7 additions & 6 deletions backend/users/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,13 @@


def claim_audit_access(user, all_emails):
access_invites = (
Access.objects.filter(user_id=None)
.filter(email__in=all_emails)
.update(user_id=user.id)
)
logger.debug(f"{user.email} granted access to {access_invites} new audits")
for email in all_emails:
access_invites = (
Access.objects.filter(user_id=None)
.filter(email__iexact=email)
.update(user_id=user.id)
)
logger.debug(f"{user.email} granted access to {access_invites} new audits")


class FACAuthenticationBackend(OpenIdConnectBackend):
Expand Down
5 changes: 3 additions & 2 deletions backend/users/test_auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,12 +114,13 @@ def test_multiple_audit_access_granted(self):
backend = FACAuthenticationBackend()

login_id = str(uuid4())
email = "a@a.com"
email = "a+a@a.com"

access1 = baker.make(Access, email=email)
access2 = baker.make(Access, email=email)

user_info = {"sub": login_id, "email": email, "all_emails": [email]}
# use different casing in the user info to ensure we're not case sensitive
user_info = {"sub": login_id, "email": "A@A.CoM", "all_emails": ["A+a@A.cOm"]}

factory = RequestFactory()
request = factory.get("/")
Expand Down

0 comments on commit 7ae174f

Please sign in to comment.