mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-08-01 15:34:53 +02:00
delete the deleteinvitationdelete view and added print statements to test
This commit is contained in:
parent
9fc1b46828
commit
08b9de2dce
2 changed files with 5 additions and 15 deletions
|
@ -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
|
||||
|
||||
|
||||
|
|
|
@ -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."""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue