Skip to content

Commit

Permalink
delete the deleteinvitationdelete view and added print statements to …
Browse files Browse the repository at this point in the history
…test
  • Loading branch information
asaki222 committed Nov 14, 2024
1 parent 9fc1b46 commit 08b9de2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 15 deletions.
5 changes: 4 additions & 1 deletion src/registrar/views/utility/mixins.py
Original file line number Diff line number Diff line change
Expand Up @@ -424,13 +424,16 @@ class DomainInvitationPermission(PermissionsLoginMixin):
def has_permission(self):
"""Check if this user has a role on the domain of this invitation."""
if not self.request.user.is_authenticated:
print("filter is not authenticated")
return False

print("is authenticated")
if not DomainInvitation.objects.filter(
id=self.kwargs["pk"], domain__permissions__user=self.request.user
).exists():
print("returned false in domain invitation objects filter")
return False

print("this actually returned true")
return True


Expand Down
15 changes: 1 addition & 14 deletions src/registrar/views/utility/permission_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,20 +154,7 @@ class DomainRequestWizardPermissionView(DomainRequestWizardPermission, TemplateV
@abc.abstractmethod
def template_name(self):
raise NotImplementedError


class DomainInvitationPermissionDeleteView(DomainInvitationPermission, DeleteView, abc.ABC):
"""Abstract view for deleting a domain invitation.
This one is fairly specialized, but this is the only thing that we do
right now with domain invitations. We still have the full
`DomainInvitationPermission` class, but here we just pair it with a
DeleteView.
"""

model = DomainInvitation
object: DomainInvitation # workaround for type mismatch in DeleteView



class DomainInvitationPermissionCancelView(DomainInvitationPermission, UpdateView, abc.ABC):
"""Abstract view for cancelling a DomainInvitation."""
Expand Down

0 comments on commit 08b9de2

Please sign in to comment.