Log when an existing link AGC is changed

This commit is contained in:
Benjamin Dauvergne 2014-11-20 15:03:23 +01:00
parent 2e387d0a94
commit c0b485c1e1
1 changed files with 4 additions and 3 deletions

View File

@ -475,9 +475,10 @@ class LoginOrLinkView(PopupViewMixin, MspOAuthSessionViewMixin, View):
unicode(request.user))
if not created:
# Previous links is replaced
# XXX: we could add support for multi-link by changing the
# unicity constraint tuple from (user,) to (user, agc).
msp_account.agc = agc
if msp_account.agc != agc:
msp_account.agc = agc
self.logger.info('msp link changed for user %r',
unicode(request.user))
msp_account.token = json.dumps(self.token)
msp_account.save()
else: