(self)
return self.cleaned_data['email']
Validate that the email is not already registered with another user
Validate that the email is not already registered with another user
Validate that the email is not already registered with another user
def clean_email(self):
        """ Validate that the email is not already registered with another user """
        if User.objects.filter(email__iexact=self.cleaned_data['email']).exclude(email__iexact=self.user.email):
            raise django_forms.ValidationError(_(u'This email is already in use. Please supply a different email.'))
        return self.cleaned_data['email']
def clean_email ( self ) : if User . objects . filter ( email__iexact = self . cleaned_data [ 'email' ] ) . exclude ( email__iexact = self . user . email ) : raise django_forms . ValidationError ( _ ( u'This email is already in use. Please supply a different email.' ) ) return self . cleaned_data [ 'email' ]