diff --git a/authentik/admin/views/stages_invitations.py b/authentik/admin/views/stages_invitations.py index b914c16d7..cf2c4bcca 100644 --- a/authentik/admin/views/stages_invitations.py +++ b/authentik/admin/views/stages_invitations.py @@ -19,7 +19,6 @@ from authentik.admin.views.utils import ( from authentik.lib.views import CreateAssignPermView from authentik.stages.invitation.forms import InvitationForm from authentik.stages.invitation.models import Invitation -from authentik.stages.invitation.signals import invitation_created class InvitationListView( @@ -59,7 +58,6 @@ class InvitationCreateView( obj = form.save(commit=False) obj.created_by = self.request.user obj.save() - invitation_created.send(sender=self, request=self.request, invitation=obj) return HttpResponseRedirect(self.success_url) diff --git a/authentik/events/models.py b/authentik/events/models.py index 5e35f2dbe..487026efa 100644 --- a/authentik/events/models.py +++ b/authentik/events/models.py @@ -35,7 +35,6 @@ class EventAction(models.TextChoices): TOKEN_VIEW = "token_view" # nosec - INVITE_CREATED = "invitation_created" INVITE_USED = "invitation_used" AUTHORIZE_APPLICATION = "authorize_application" diff --git a/authentik/events/signals.py b/authentik/events/signals.py index a7cb8b102..03ed367f9 100644 --- a/authentik/events/signals.py +++ b/authentik/events/signals.py @@ -14,7 +14,7 @@ from authentik.core.models import User from authentik.core.signals import password_changed from authentik.events.models import Event, EventAction from authentik.stages.invitation.models import Invitation -from authentik.stages.invitation.signals import invitation_created, invitation_used +from authentik.stages.invitation.signals import invitation_used from authentik.stages.user_write.signals import user_write @@ -79,16 +79,6 @@ def on_user_login_failed( thread.run() -@receiver(invitation_created) -# pylint: disable=unused-argument -def on_invitation_created(sender, request: HttpRequest, invitation: Invitation, **_): - """Log Invitation creation""" - thread = EventNewThread( - EventAction.INVITE_CREATED, request, invitation_uuid=invitation.invite_uuid.hex - ) - thread.run() - - @receiver(invitation_used) # pylint: disable=unused-argument def on_invitation_used(sender, request: HttpRequest, invitation: Invitation, **_): diff --git a/authentik/events/utils.py b/authentik/events/utils.py index 32dc69364..599b04ce9 100644 --- a/authentik/events/utils.py +++ b/authentik/events/utils.py @@ -28,7 +28,7 @@ def cleanse_dict(source: Dict[Any, Any]) -> Dict[Any, Any]: final_dict[key] = SafeExceptionReporterFilter.cleansed_substitute else: final_dict[key] = value - except TypeError: + except TypeError: # pragma: no cover final_dict[key] = value if isinstance(value, dict): final_dict[key] = cleanse_dict(value) diff --git a/authentik/stages/invitation/signals.py b/authentik/stages/invitation/signals.py index e5402758c..2b4221407 100644 --- a/authentik/stages/invitation/signals.py +++ b/authentik/stages/invitation/signals.py @@ -1,7 +1,5 @@ """authentik invitation signals""" from django.core.signals import Signal -# Arguments: request: HttpRequest, invitation: Invitation -invitation_created = Signal() # Arguments: request: HttpRequest, invitation: Invitation invitation_used = Signal()