diff --git a/appli_project/appli_socle/forms.py b/appli_project/appli_socle/forms.py index d1b0fa7..90a62ad 100644 --- a/appli_project/appli_socle/forms.py +++ b/appli_project/appli_socle/forms.py @@ -221,7 +221,7 @@ class CodeDeConfirmationForm(forms.Form): 'email': email, 'comment': self.value.get('comment', ''), } - self.user_cache, created = models.ProfilOffre.objects.get_or_create(**kwargs) + self.user_cache, self.created = models.ProfilOffre.objects.get_or_create(**kwargs) self.user_cache.backend = 'appli_project.appli_socle.backends.ProfilOffreMoteurAuthentification' if created: self.user_cache.set_unusable_password() diff --git a/appli_project/appli_socle/views.py b/appli_project/appli_socle/views.py index 7764323..44a2144 100644 --- a/appli_project/appli_socle/views.py +++ b/appli_project/appli_socle/views.py @@ -252,7 +252,7 @@ class VueCodeDeConfirmationEmail(FormView): _(u'confirmation de l\'email {email} avec le jeton {jeton}'), email=form.value['email'], jeton=form.cleaned_data['jeton']) - if not form.user_cache.has_usable_password(): + if getattr(self, 'created', False): self.request.record('nouveau-compte-offre', _(u'création du compte {email}'), email=form.value['email'])