still tweaking webfinger syntax

This commit is contained in:
Mouse Reeve
2020-11-01 12:29:31 -08:00
parent 65371d6904
commit 4b7de93c90
2 changed files with 3 additions and 3 deletions

View File

@ -19,14 +19,14 @@ def webfinger(request):
if not resource and not resource.startswith('acct:'):
return HttpResponseNotFound()
username = resource.replace('acct:@', '')
username = resource.replace('acct:', '')
try:
user = models.User.objects.get(username=username)
except models.User.DoesNotExist:
return HttpResponseNotFound('No account found')
return JsonResponse({
'subject': 'acct:@%s' % (user.username),
'subject': 'acct:%s' % (user.username),
'links': [
{
'rel': 'self',