diff --git a/tiled/client/context.py b/tiled/client/context.py index 840f97cde..bf667f662 100644 --- a/tiled/client/context.py +++ b/tiled/client/context.py @@ -172,7 +172,7 @@ def __repr__(self): ",".join(f"'{identity['id']}'" for identity in identities) ) if self.api_key is not None: - auth_info.append(f"with API key '{self.api_key[:8]}...'") + auth_info.append(f"with API key '{self.api_key[:min(len(self.api_key)//2, 8)]}...'") auth_repr = " ".join(auth_info) return f"<{type(self).__name__} {auth_repr}>"