Skip to content

Commit

Permalink
Merge aeeb33c into 695aa5b
Browse files Browse the repository at this point in the history
  • Loading branch information
qurbat committed Jan 14, 2020
2 parents 695aa5b + aeeb33c commit 539c846
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
10 changes: 10 additions & 0 deletions baseframe/forms/validators.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
from lxml import html
from pyisemail import is_email
import dns.resolver
import emoji
import requests

from coaster.utils import deobfuscate_email, make_name
Expand Down Expand Up @@ -319,6 +320,15 @@ def __call__(self, form, field):
return
else:
raise ValidationError(self.message)

class IsEmoji(object):

def __init__(self, message=None):
self.message = message

def __call__(self, form, field):
if not field.data in emoji.UNICODE_EMOJI:
raise ValidationError(self.message)


class IsNotPublicEmailDomain(object):
Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
'pytz',
'pyIsEmail',
'dnspython',
'emoji',
'WTForms>=2.2',
'Flask>=1.0',
'Flask-Assets',
Expand Down

0 comments on commit 539c846

Please sign in to comment.