From f471cf656f286ec5738ce9526bd698e6fe9ae9d3 Mon Sep 17 00:00:00 2001 From: Cy Date: Mon, 1 Jun 2020 08:22:36 +0000 Subject: [PATCH] Missed a same_username Making sure to check the username in the fallback too. Otherwise, seems to be working! --- brutaldon/views.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/brutaldon/views.py b/brutaldon/views.py index bb73eba..4ba4b70 100644 --- a/brutaldon/views.py +++ b/brutaldon/views.py @@ -84,6 +84,7 @@ def get_usercontext(request): ): raise NotLoggedInException() mastodon = Mastodon( + debug_requests=True, client_id=client.client_id, client_secret=client.client_secret, access_token=user.access_token, @@ -720,18 +721,16 @@ def user(request, username, prev=None, next=None): user_dict = None # pleroma currently flops if the user's not already locally known # this is a BUG that they MUST FIX - # but until then, we might have to "prime the engine" - # by doing a regular search, if the account search fails - # to return results. + # but until then, we might have to fallback to a regular search, + # if the account search fails to return results. for dict in mastodon.account_search(username): - print("check", dict.acct) if not same_username(account, dict.acct, username): continue user_dict = dict break else: for dict in mastodon.search(username, - result_type="accounts", - account_id=username): + result_type="accounts").accounts: + if not same_username(account, dict.acct, username): continue user_dict = dict break else: