2
0
mirror of https://github.com/jfmcbrayer/brutaldon synced 2024-12-22 21:27:58 +01:00

Fix local user references with domain name on Pleroma

This commit is contained in:
Jason McBrayer 2019-01-24 08:48:44 -05:00
parent dd20a1de36
commit 2d3d88da72

View File

@ -389,7 +389,8 @@ def user(request, username, prev=None, next=None):
return redirect(about) return redirect(about)
try: try:
user_dict = [dict for dict in mastodon.account_search(username) user_dict = [dict for dict in mastodon.account_search(username)
if dict.acct == username][0] if ((dict.acct == username) or
(dict.acct == username.split('@')[0]))][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)