appli_socle/views: change checking for profile offre creation

This commit is contained in:
Benjamin Dauvergne 2013-09-26 09:57:01 +02:00
parent 97a1312026
commit 6bcf098213
2 changed files with 2 additions and 2 deletions

View File

@ -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()

View File

@ -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'])