def credentials(self): username = self.auth.username or self.id.username username = username.encode() if username else None password = self.auth.password.encode() if self.auth.password else None return Credentials(username, password)
def credentials(self): return Credentials(self.auth.username or self.id.username, self.auth.password)