From 38a3d38d0f5a8d4d8e7f1567fa8202239aa76aa0 Mon Sep 17 00:00:00 2001 From: CocoByte Date: Mon, 2 Dec 2024 19:49:35 -0700 Subject: [PATCH] remove stray char (keyboard error?) --- src/registrar/tests/test_views_portfolio.py | 2 +- src/registrar/views/portfolios.py | 10 ++-------- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/src/registrar/tests/test_views_portfolio.py b/src/registrar/tests/test_views_portfolio.py index df5c19d7c..985061cb7 100644 --- a/src/registrar/tests/test_views_portfolio.py +++ b/src/registrar/tests/test_views_portfolio.py @@ -1876,7 +1876,7 @@ class TestPortfolio(WebTest): portfolio=self.portfolio, roles=[UserPortfolioRoleChoices.ORGANIZATION_MEMBER], ) -e with patch("django.contrib.messages.success") as mock_success: + with patch("django.contrib.messages.success") as mock_success: self.client.force_login(self.user) response = self.client.post( reverse("invitedmember-delete", kwargs={"pk": invitation.pk}), diff --git a/src/registrar/views/portfolios.py b/src/registrar/views/portfolios.py index f74f8c1bf..9e5489b00 100644 --- a/src/registrar/views/portfolios.py +++ b/src/registrar/views/portfolios.py @@ -548,7 +548,7 @@ class NewMemberView(PortfolioMembersPermissionView, FormMixin): # Check to see if an invite has already been sent try: invite = PortfolioInvitation.objects.get(email=email, portfolio=self.object) - if invite: # We have an existin invite + if invite: # We have an existin invite # check if the invite has already been accepted if invite.status == PortfolioInvitation.PortfolioInvitationStatus.RETRIEVED: add_success = False @@ -621,18 +621,12 @@ class NewMemberView(PortfolioMembersPermissionView, FormMixin): requested_user = User.objects.filter(email=requested_email).first() permission_exists = UserPortfolioPermission.objects.filter(user=requested_user, portfolio=self.object).exists() if not requested_user or not permission_exists: - return self._make_invitation(requested_email, requestor) + return self._make_invitation(requested_email, requestor) else: if permission_exists: messages.warning(self.request, "User is already a member of this portfolio.") return redirect(self.get_success_url()) - - - - - - # look up a user with that email try: requested_user = User.objects.get(email=requested_email)