Ejemplo n.º 1
0
 def clean_email(self):
     """
     Validate that the supplied email address is unique for the
     site.
     
     """
     if RegistrationProfile.objects(
         email__iexact=self.cleaned_data['email']):
         raise forms.ValidationError(_(u'This email address is already in use. Please supply a different email address.'))
     return self.cleaned_data['email']
Ejemplo n.º 2
0
 def clean_email(self):
     """
     Validate that the supplied email address is unique for the
     site.
     
     """
     if RegistrationProfile.objects(
         email__iexact=self.cleaned_data['email']):
         raise forms.ValidationError(_(u'This email address is already in use. Please supply a different email address.'))
     return self.cleaned_data['email']
Ejemplo n.º 3
0
    def clean_username(self):
        """
        Validate that the username is alphanumeric and is not already
        in use.

        """
        if RegistrationProfile.objects(
            username__iexact=self.cleaned_data['username']):
            
            raise forms.ValidationError(
                _(u'This username is already taken. Please choose another.'))
        
        return self.cleaned_data['username']
Ejemplo n.º 4
0
    def clean_username(self):
        """
        Validate that the username is alphanumeric and is not already
        in use.

        """
        if RegistrationProfile.objects(
            username__iexact=self.cleaned_data['username']):

            raise forms.ValidationError(
                _(u'This username is already taken. Please choose another.'))

        return self.cleaned_data['username']