Exemple #1
0
 def clean_email(self):
     email = self.cleaned_data["email"]
     is_email = "@" in email
     if is_email:
         self.users_cache = User.objects.filter(email__iexact=email,
                                                is_active=True)
     else:
         self.users_cache = User.objects.filter(username__iexact=email,
                                                is_active=True)
     profile = None
     for user in self.users_cache:
         try:
             profile = user.get_profile()
         except UserProfile.DoesNotExist:
             user.delete()
     if not profile and not drupal.migrate(email):
         msg = _("That e-mail address isn't associated to a user account. ")
         msg2 = _("You didn't finish registering the last time. ")
         msg2 += _("Please register a new account.")
         if len(self.users_cache) == 0:
             if not is_email:
                 msg = _("Username not found. ")
             msg += _("Are you sure you've registered?")
             raise forms.ValidationError(msg)
         else:
             raise forms.ValidationError(msg2)
     return email
Exemple #2
0
 def clean_email(self):
     email = self.cleaned_data["email"]
     is_email = "@" in email
     if is_email:
         self.users_cache = User.objects.filter(
                             email__iexact=email,
                             is_active=True
                         )
     else:
         self.users_cache = User.objects.filter(
                 username__iexact=email,
                 is_active=True
             )
     profile = None
     for user in self.users_cache:
         try:
             profile = user.get_profile()
         except UserProfile.DoesNotExist:
             user.delete()
     if not profile and not drupal.migrate(email):
         if len(self.users_cache) == 0:
             if is_email:
                 msg = _("That e-mail address isn't associated to a user account. ")
             else:
                 msg = _("Username not found. ")
             msg += _("Are you sure you've registered?")
             raise forms.ValidationError(msg)
         else:
             msg = _("You did not finish the registration proccess last time. ")
             msg += _("Please register a new account.")
             raise forms.ValidationError(msg)
     return email
Exemple #3
0
 def clean_email(self):
     email = self.cleaned_data["email"]
     self.users_cache = User.objects.filter(
                             email__iexact=email,
                             is_active=True
                         )
     if len(self.users_cache) == 0 and not drupal.migrate(email):
         raise forms.ValidationError(_("That e-mail address doesn't have an associated user account. Are you sure you've registered?"))
     profile = None
     for user in self.users_cache:
         try:
             profile = user.get_profile()
         except UserProfile.DoesNotExist:
             user.delete()
     if not profile:
         msg = _("It seams that you did not finished the registration proccess during your last visit to the site.")
         msg += _("Please register a new account.")
         raise forms.ValidationError(msg)
     return email
Exemple #4
0
 def clean_email(self):
     email = self.cleaned_data["email"]
     self.users_cache = User.objects.filter(email__iexact=email,
                                            is_active=True)
     if len(self.users_cache) == 0 and not drupal.migrate(email):
         raise forms.ValidationError(
             _("That e-mail address doesn't have an associated user account. Are you sure you've registered?"
               ))
     profile = None
     for user in self.users_cache:
         try:
             profile = user.get_profile()
         except UserProfile.DoesNotExist:
             user.delete()
     if not profile:
         msg = _(
             "It seams that you did not finished the registration proccess during your last visit to the site."
         )
         msg += _("Please register a new account.")
         raise forms.ValidationError(msg)
     return email