mirror of
http://git.carcosa.net/jmcbray/brutaldon.git
synced 2024-11-27 09:10:08 -05:00
Missed a same_username
Making sure to check the username in the fallback too. Otherwise, seems to be working!
This commit is contained in:
parent
6d22b6fc66
commit
f471cf656f
@ -84,6 +84,7 @@ def get_usercontext(request):
|
|||||||
):
|
):
|
||||||
raise NotLoggedInException()
|
raise NotLoggedInException()
|
||||||
mastodon = Mastodon(
|
mastodon = Mastodon(
|
||||||
|
debug_requests=True,
|
||||||
client_id=client.client_id,
|
client_id=client.client_id,
|
||||||
client_secret=client.client_secret,
|
client_secret=client.client_secret,
|
||||||
access_token=user.access_token,
|
access_token=user.access_token,
|
||||||
@ -720,18 +721,16 @@ def user(request, username, prev=None, next=None):
|
|||||||
user_dict = None
|
user_dict = None
|
||||||
# pleroma currently flops if the user's not already locally known
|
# pleroma currently flops if the user's not already locally known
|
||||||
# this is a BUG that they MUST FIX
|
# this is a BUG that they MUST FIX
|
||||||
# but until then, we might have to "prime the engine"
|
# but until then, we might have to fallback to a regular search,
|
||||||
# by doing a regular search, if the account search fails
|
# if the account search fails to return results.
|
||||||
# to return results.
|
|
||||||
for dict in mastodon.account_search(username):
|
for dict in mastodon.account_search(username):
|
||||||
print("check", dict.acct)
|
|
||||||
if not same_username(account, dict.acct, username): continue
|
if not same_username(account, dict.acct, username): continue
|
||||||
user_dict = dict
|
user_dict = dict
|
||||||
break
|
break
|
||||||
else:
|
else:
|
||||||
for dict in mastodon.search(username,
|
for dict in mastodon.search(username,
|
||||||
result_type="accounts",
|
result_type="accounts").accounts:
|
||||||
account_id=username):
|
if not same_username(account, dict.acct, username): continue
|
||||||
user_dict = dict
|
user_dict = dict
|
||||||
break
|
break
|
||||||
else:
|
else:
|
||||||
|
Loading…
Reference in New Issue
Block a user