fix Firefish

This commit is contained in:
Your Name 2024-10-14 23:49:24 -04:00 committed by Henri Dickson
parent 72d9fb2e42
commit 1b4c1ef87e

View file

@ -592,6 +592,17 @@ class Mastodon:
uid=mastodon_account.uid,
domain=mastodon_account.domain,
).first()
if not existing_account:
existing_account = MastodonAccount.objects.filter(
handle=mastodon_account.handle,
domain=mastodon_account.domain,
).first()
if existing_account:
# this is only needed if server is Firefish
logger.warning(
f"USER ID CHANGED: {existing_account.uid} -> {mastodon_account.uid} for {existing_account.handle}"
)
existing_account.uid = mastodon_account.uid
if existing_account:
existing_account.access_token = mastodon_account.access_token
existing_account.refresh_token = mastodon_account.refresh_token