Skip to content

Commit

Permalink
events: fix gdpr compliance always running (cherry-pick #7491) (#7505)
Browse files Browse the repository at this point in the history
events: fix gdpr compliance always running

Signed-off-by: Marc 'risson' Schmitt <marc.schmitt@risson.space>
Co-authored-by: Marc 'risson' Schmitt <marc.schmitt@risson.space>
  • Loading branch information
gcp-cherry-pick-bot[bot] and rissson authored Nov 9, 2023
1 parent 1def986 commit 3809400
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion authentik/events/signals.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
from authentik.flows.models import Stage
from authentik.flows.planner import PLAN_CONTEXT_SOURCE, FlowPlan
from authentik.flows.views.executor import SESSION_KEY_PLAN
from authentik.lib.config import CONFIG
from authentik.stages.invitation.models import Invitation
from authentik.stages.invitation.signals import invitation_used
from authentik.stages.password.stage import PLAN_CONTEXT_METHOD, PLAN_CONTEXT_METHOD_ARGS
Expand Down Expand Up @@ -92,4 +93,5 @@ def event_post_save_notification(sender, instance: Event, **_):
@receiver(pre_delete, sender=User)
def event_user_pre_delete_cleanup(sender, instance: User, **_):
"""If gdpr_compliance is enabled, remove all the user's events"""
gdpr_cleanup.delay(instance.pk)
if CONFIG.get_bool("gdpr_compliance", True):
gdpr_cleanup.delay(instance.pk)

0 comments on commit 3809400

Please sign in to comment.