Found out why I got this error. I forgot to return a value for the
validated field. Because this field was prohibited of being NULL, I
got an error.

I achieved what I wanted with the following code:

if self.initial['email'] != self.cleaned_data['email']:
            try:
                user =
User.objects.get(email__exact=self.cleaned_data['email'])
            except User.DoesNotExist:
                return self.cleaned_data['email']
            raise forms.ValidationError('Dit e-mail adres is al in
gebruik. Kiest \
                                         u alstublieft een andere.')
        else:
            return self.cleaned_data['email']

Many thanks for those above this post who helped me.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to