Remove usages of user.username and try to use user.get_username if available.