Files
notifications-admin/app/main/validators.py

13 lines
350 B
Python

from wtforms import ValidationError
class Blacklist(object):
def __init__(self, message=None):
if not message:
message = 'Password is blacklisted.'
self.message = message
def __call__(self, form, field):
if field.data in ['password1234', 'passw0rd1234']:
raise ValidationError(self.message)