Skip to content

Commit

Permalink
Log when a partner user is unlinked (#2133)
Browse files Browse the repository at this point in the history
  • Loading branch information
acasajus authored Jun 26, 2024
1 parent 209ed65 commit 1ecc5eb
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app/proton/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from typing import Optional

from app.db import Session
from app.log import LOG
from app.errors import ProtonPartnerNotSetUp
from app.models import Partner, PartnerUser, User

Expand Down Expand Up @@ -30,6 +31,7 @@ def perform_proton_account_unlink(current_user: User):
user_id=current_user.id, partner_id=proton_partner.id
)
if partner_user is not None:
LOG.info(f"User {current_user} has unlinked the account from {partner_user}")
PartnerUser.delete(partner_user.id)
Session.commit()
agent.record_custom_event("AccountUnlinked", {"partner": proton_partner.name})

0 comments on commit 1ecc5eb

Please sign in to comment.