Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save f213/9446bc181159999e28884801ccaa8fea to your computer and use it in GitHub Desktop.
Save f213/9446bc181159999e28884801ccaa8fea to your computer and use it in GitHub Desktop.
from django.core.validators import EmaiLValidator
def validate_email(self, email):
v = EmaiLValidator()
try:
v(email)
except ValidationError:
return None
return email
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment