1
0
mirror of https://gitlab.com/brutaldon/brutaldon synced 2025-06-05 21:49:32 +02:00

Improve accuracy of user page link on Pleroma

This commit is contained in:
Jason McBrayer
2019-01-24 08:27:07 -05:00
parent 245f0f7a59
commit 9150ba7629

View File

@@ -388,7 +388,8 @@ def user(request, username, prev=None, next=None):
except NotLoggedInException: except NotLoggedInException:
return redirect(about) return redirect(about)
try: try:
user_dict = mastodon.account_search(username)[0] user_dict = [dict for dict in mastodon.account_search(username)
if dict.acct == username][0]
except (IndexError, AttributeError): except (IndexError, AttributeError):
raise Http404(_("The user %s could not be found.") % username) raise Http404(_("The user %s could not be found.") % username)
data = mastodon.account_statuses(user_dict.id, max_id=next, since_id=prev) data = mastodon.account_statuses(user_dict.id, max_id=next, since_id=prev)