diff --git a/mastodon/models/bluesky.py b/mastodon/models/bluesky.py index 713a9938..5e22fd0d 100644 --- a/mastodon/models/bluesky.py +++ b/mastodon/models/bluesky.py @@ -158,9 +158,11 @@ def refresh(self, save=True, did_check=True): logger.warning("Bluesky: client not logged in.") # this should not happen return False if self.handle != profile.handle: - logger.warning( - f"ATProto refresh: handle mismatch {self.handle} from did doc -> {profile.handle} from PDS" - ) + if self.handle: + logger.warning( + f"ATProto refresh: handle mismatch {self.handle} from did doc -> {profile.handle} from PDS" + ) + self.handle = profile.handle self.account_data = { k: v for k, v in profile.__dict__.items() if isinstance(v, (int, str)) } diff --git a/mastodon/models/common.py b/mastodon/models/common.py index a946b684..8d85cbf8 100644 --- a/mastodon/models/common.py +++ b/mastodon/models/common.py @@ -82,15 +82,12 @@ def to_dict(self): for k, v in self.__dict__.items() if k not in [ - "_state", - "_client", - "_profile", - "api_domain", "created", "modified", "last_refresh", "last_reachable", ] + and not k.startswith("_") } return d