Skip to content

Commit

Permalink
Set user private in account deletion process
Browse files Browse the repository at this point in the history
Setting private after legal backup but before anonymization via account_canceled signal
  • Loading branch information
stefanw committed Jul 18, 2024
1 parent 40bb7d9 commit c1e4fa6
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion froide/account/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 205,11 @@ def start_cancel_account_process(


def cancel_user(user: User, delete: bool = False) -> None:
# Set user to private here to ensure that
# all data is anonymized before deletion
user.private = True
user.save()

with transaction.atomic():
account_canceled.send(sender=User, user=user)

Expand All @@ -216,7 221,6 @@ def cancel_user(user: User, delete: bool = False) -> None:

user.organization_name = ""
user.organization_url = ""
user.private = True
user.terms = False
user.address = ""
user.profile_text = ""
Expand Down

0 comments on commit c1e4fa6

Please sign in to comment.