Skip to content

Commit

Permalink
Update validators.py
Browse files Browse the repository at this point in the history
  • Loading branch information
qurbat authored Jan 14, 2020
1 parent 0bdad37 commit d53fae0
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions baseframe/forms/validators.py
Original file line number Diff line number Diff line change
Expand Up @@ -322,16 +322,12 @@ def __call__(self, form, field):
raise ValidationError(self.message)

class IsEmoji(object):
"""
Validate whether the supplied string is an emoji.
"""

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

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


Expand Down

0 comments on commit d53fae0

Please sign in to comment.