The TypeError is about the *last* line in the traceback: One of `self.username' or 'self.password' is set to 'None'.