mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-02-05 10:53:28 -05:00
13 lines
350 B
Python
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)
|