On Tue, Dec 20, 2016 at 05:28:48AM -0800, NoviceSortOf wrote:
> 
> Why does validate_email return None irregardless of what is typed in?
> 
> >>> from django.core.validators import validate_email
> >>> x = validators.validate_email('t...@example.com')
> >>> print x
> None
> >>>
> 
> Shouldn't it be returning True or False?

According to
https://docs.djangoproject.com/en/1.10/ref/forms/validation/#validators:

> A validator is merely a callable object or function that takes a
> value and simply returns nothing if the value is valid or raises a
> ValidationError if not.

Cheers,

Michal

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/20161220134113.GB1628%40koniiiik.org.
For more options, visit https://groups.google.com/d/optout.

Attachment: signature.asc
Description: Digital signature

Reply via email to