Skip to content

Commit

Permalink
fix RecursionError when printing public API User object without email…
Browse files Browse the repository at this point in the history
… fetched (#4193)
  • Loading branch information
speezepearson committed Sep 6, 2022
1 parent b9683f4 commit 54d64ef
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion wandb/apis/public.py
Expand Up @@ -1149,7 +1149,16 @@ def generate_api_key(self, description=None):
return None

def __repr__(self):
return f"<User {self.email}>"
if "email" in self._attrs:
return f"<User {self._attrs['email']}>"
elif "username" in self._attrs:
return f"<User {self._attrs['username']}>"
elif "id" in self._attrs:
return f"<User {self._attrs['id']}>"
elif "name" in self._attrs:
return f"<User {self._attrs['name']!r}>"
else:
return "<User ???>"


class Member(Attrs):
Expand Down

0 comments on commit 54d64ef

Please sign in to comment.