mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-08-14 05:29:43 +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):
|
def has_permission(self):
|
||||||
"""Check if this user has a role on the domain of this invitation."""
|
"""Check if this user has a role on the domain of this invitation."""
|
||||||
if not self.request.user.is_authenticated:
|
if not self.request.user.is_authenticated:
|
||||||
|
print("filter is not authenticated")
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
print("is authenticated")
|
||||||
if not DomainInvitation.objects.filter(
|
if not DomainInvitation.objects.filter(
|
||||||
id=self.kwargs["pk"], domain__permissions__user=self.request.user
|
id=self.kwargs["pk"], domain__permissions__user=self.request.user
|
||||||
).exists():
|
).exists():
|
||||||
|
print("returned false in domain invitation objects filter")
|
||||||
return False
|
return False
|
||||||
|
print("this actually returned true")
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -156,19 +156,6 @@ class DomainRequestWizardPermissionView(DomainRequestWizardPermission, TemplateV
|
||||||
raise NotImplementedError
|
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):
|
class DomainInvitationPermissionCancelView(DomainInvitationPermission, UpdateView, abc.ABC):
|
||||||
"""Abstract view for cancelling a DomainInvitation."""
|
"""Abstract view for cancelling a DomainInvitation."""
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue