'Raise Response or return None.
Usernames are limited to alphanumeric characters, plus ".,-_:@ ",
and can only be 32 characters long.'

def change_username(self, suggested):

    suggested = (suggested and suggested.strip())
    if (not suggested):
        raise UsernameIsEmpty(suggested)
    if (len(suggested) > USERNAME_MAX_SIZE):
        raise UsernameTooLong(suggested)
    if (set(suggested) - ASCII_ALLOWED_IN_USERNAME):
        raise UsernameContainsInvalidCharacters(suggested)
    lowercased = suggested.lower()
    for name in (lowercased, (lowercased + u'.spt')):
        if (name in gratipay.RESTRICTED_USERNAMES):
            raise UsernameIsRestricted(suggested)
    if (suggested != self.username):
        try:
            with self.db.get_cursor(back_as=tuple) as c:
                self.app.add_event(c, u'participant', dict(id=self.id, action=u'set', values=dict(username=suggested)))
                actual = c.one(u'UPDATE    participants    SET    username=%s,    username_lower=%s    WHERE    username=%s    RETURNING    username,    username_lower', (suggested, lowercased, self.username))
        except IntegrityError:
            raise UsernameAlreadyTaken(suggested)
        assert ((suggested, lowercased) == actual)
        self.set_attributes(username=suggested, username_lower=lowercased)
    return suggested
