def clean_email(self):
        """ 
        Validate that the email is not already registered with another user.
        
        """
        if self.cleaned_data['email'].lower() == self.user.email:
            raise forms.ValidationError(_(u"You're already known under "
                                                "this email address."))
        if get_user_model().objects.filter(
                email__iexact=self.cleaned_data['email']).exclude(
                    email__iexact=self.user.email):
            raise forms.ValidationError(_(u'This email address is already '
                        'in use. Please supply a different email address.'))
        return self.cleaned_data['email']
def clean_email ( self ) : if self . cleaned_data [ 'email' ] . lower ( ) == self . user . email : raise forms . ValidationError ( _ ( u"You're already known under " "this email address." ) ) if get_user_model ( ) . objects . filter ( email__iexact = self . cleaned_data [ 'email' ] ) . exclude ( email__iexact = self . user . email ) : raise forms . ValidationError ( _ ( u'This email address is already ' 'in use. Please supply a different email address.' ) ) return self . cleaned_data [ 'email' ]
Validate that the email is not already registered with another user.