Skip to content
This repository has been archived by the owner on Nov 29, 2023. It is now read-only.

Commit

Permalink
Update manifest with markdown version of files
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronbassett committed Nov 4, 2015
1 parent e562ad5 commit c91a07f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
8 changes: 4 additions & 4 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
include AUTHORS.rst
include CONTRIBUTING.rst
include HISTORY.rst
include AUTHORS.md
include CONTRIBUTING.md
include HISTORY.md
include LICENSE
include README.rst
include README.md
recursive-include disposable_email_checker *.html *.png *.gif *js *.css *jpg *jpeg *svg *py
8 changes: 8 additions & 0 deletions disposable_email_checker/validators.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from six.moves import range
from django.conf import settings
from django.utils.encoding import force_text
from django.core import validators
from django.core.exceptions import ValidationError
from django.utils.translation import ugettext_lazy as _
from django.core.urlresolvers import get_callable
Expand Down Expand Up @@ -33,6 +34,13 @@ def __init__(self, message=None, code=None, whitelist=None):

def __call__(self, value):
value = force_text(value)

# Catch invalid emails before we check if they're disposable
try:
validators.validate_email(value)
except ValidationError:
return

user_part, domain_part = value.rsplit('@', 1)

if domain_part not in self.whitelist:
Expand Down

0 comments on commit c91a07f

Please sign in to comment.