mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-12-20 23:26:42 +00:00
still tweaking webfinger syntax
This commit is contained in:
parent
65371d6904
commit
4b7de93c90
2 changed files with 3 additions and 3 deletions
|
@ -52,7 +52,7 @@ def handle_remote_webfinger(query):
|
||||||
try:
|
try:
|
||||||
user = models.User.objects.get(username=query)
|
user = models.User.objects.get(username=query)
|
||||||
except models.User.DoesNotExist:
|
except models.User.DoesNotExist:
|
||||||
url = 'https://%s/.well-known/webfinger?resource=acct:@%s' % \
|
url = 'https://%s/.well-known/webfinger?resource=acct:%s' % \
|
||||||
(domain, query)
|
(domain, query)
|
||||||
try:
|
try:
|
||||||
response = requests.get(url)
|
response = requests.get(url)
|
||||||
|
|
|
@ -19,14 +19,14 @@ def webfinger(request):
|
||||||
if not resource and not resource.startswith('acct:'):
|
if not resource and not resource.startswith('acct:'):
|
||||||
return HttpResponseNotFound()
|
return HttpResponseNotFound()
|
||||||
|
|
||||||
username = resource.replace('acct:@', '')
|
username = resource.replace('acct:', '')
|
||||||
try:
|
try:
|
||||||
user = models.User.objects.get(username=username)
|
user = models.User.objects.get(username=username)
|
||||||
except models.User.DoesNotExist:
|
except models.User.DoesNotExist:
|
||||||
return HttpResponseNotFound('No account found')
|
return HttpResponseNotFound('No account found')
|
||||||
|
|
||||||
return JsonResponse({
|
return JsonResponse({
|
||||||
'subject': 'acct:@%s' % (user.username),
|
'subject': 'acct:%s' % (user.username),
|
||||||
'links': [
|
'links': [
|
||||||
{
|
{
|
||||||
'rel': 'self',
|
'rel': 'self',
|
||||||
|
|
Loading…
Reference in a new issue