def clean_username(self, username):
        validator = EmailValidator()
        try:
            validator(username)  # If invalid, will raise a ValidationError
        except ValidationError:
            log.debug('Invalid email address: %r', username)
            return None
        else:
            return username
Makes sure that the username is a valid email address.
dataset/ETHPy150Open dropbox/nsot/nsot/middleware/auth.py/EmailHeaderBackend.clean_username