diff --git a/src/registrar/views/utility/mixins.py b/src/registrar/views/utility/mixins.py index c1cf97d82..bc13ac1da 100644 --- a/src/registrar/views/utility/mixins.py +++ b/src/registrar/views/utility/mixins.py @@ -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 diff --git a/src/registrar/views/utility/permission_views.py b/src/registrar/views/utility/permission_views.py index 5ba84b3d6..87021a81f 100644 --- a/src/registrar/views/utility/permission_views.py +++ b/src/registrar/views/utility/permission_views.py @@ -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."""