mirror of
https://github.com/simple-login/app.git
synced 2024-11-18 01:40:38 +01:00
Log when a partner user is unlinked (#2133)
This commit is contained in:
parent
209ed65ebc
commit
1ecc5eb89b
1 changed files with 2 additions and 0 deletions
|
@ -2,6 +2,7 @@ from newrelic import agent
|
||||||
from typing import Optional
|
from typing import Optional
|
||||||
|
|
||||||
from app.db import Session
|
from app.db import Session
|
||||||
|
from app.log import LOG
|
||||||
from app.errors import ProtonPartnerNotSetUp
|
from app.errors import ProtonPartnerNotSetUp
|
||||||
from app.models import Partner, PartnerUser, User
|
from app.models import Partner, PartnerUser, User
|
||||||
|
|
||||||
|
@ -30,6 +31,7 @@ def perform_proton_account_unlink(current_user: User):
|
||||||
user_id=current_user.id, partner_id=proton_partner.id
|
user_id=current_user.id, partner_id=proton_partner.id
|
||||||
)
|
)
|
||||||
if partner_user is not None:
|
if partner_user is not None:
|
||||||
|
LOG.info(f"User {current_user} has unlinked the account from {partner_user}")
|
||||||
PartnerUser.delete(partner_user.id)
|
PartnerUser.delete(partner_user.id)
|
||||||
Session.commit()
|
Session.commit()
|
||||||
agent.record_custom_event("AccountUnlinked", {"partner": proton_partner.name})
|
agent.record_custom_event("AccountUnlinked", {"partner": proton_partner.name})
|
||||||
|
|
Loading…
Reference in a new issue