diff --git a/authentik/stages/authenticator_totp/apps.py b/authentik/stages/authenticator_totp/apps.py index 9535e9bd3..9ca682cda 100644 --- a/authentik/stages/authenticator_totp/apps.py +++ b/authentik/stages/authenticator_totp/apps.py @@ -1,6 +1,4 @@ """TOTP""" -from importlib import import_module - from django.apps import AppConfig @@ -10,6 +8,3 @@ class AuthentikStageAuthenticatorTOTPConfig(AppConfig): name = "authentik.stages.authenticator_totp" label = "authentik_stages_authenticator_totp" verbose_name = "authentik Stages.Authenticator.TOTP" - - def ready(self): - import_module("authentik.stages.authenticator_totp.signals") diff --git a/authentik/stages/authenticator_totp/signals.py b/authentik/stages/authenticator_totp/signals.py deleted file mode 100644 index 530233a8a..000000000 --- a/authentik/stages/authenticator_totp/signals.py +++ /dev/null @@ -1,16 +0,0 @@ -"""totp authenticator signals""" -from django.db.models.signals import pre_delete -from django.dispatch import receiver -from django_otp.plugins.otp_totp.models import TOTPDevice - -from authentik.events.models import Event - - -@receiver(pre_delete, sender=TOTPDevice) -# pylint: disable=unused-argument -def pre_delete_event(sender, instance: TOTPDevice, **_): - """Create event before deleting TOTP Devices""" - # Create event with email notification - event = Event.new("totp_disable", message="User disabled Time-based OTP.") - event.set_user(instance.user) - event.save()