When need to check that "username" is not an email :
class IS_NOT_EMAIL: def __init__(self, error_message='You can\'t use email as username'): self.e = error_message def __call__(self, value): if not IS_EMAIL()(value)[1]: return (value, self.e) return (value, None)
Comments (0)