Ask password at unlinking when the user has no usable password (fixes #10524) (bis).

This commit is contained in:
Mikaël Ates 2016-04-14 10:20:28 +02:00
parent f1b2ced61b
commit 5704e98495
1 changed files with 3 additions and 0 deletions

View File

@ -385,6 +385,9 @@ class UnlinkView(LoggerMixin, SingleObjectMixin, FormView):
return ctx
def form_valid(self, form):
form.save()
self.logger.info(u'user %s has set a password', self.fc_account.user)
self.fc_account.user.backend = 'authentic2.backends.models_backend.ModelBackend'
msg_tpl = _('The link with the FranceConnect account {fc_account} has been deleted.')
msg = msg_tpl.format(fc_account=self.fc_account)
self.logger.info(u'user %s unlinked from %s', self.fc_account.user, self.fc_account)