Fixes webfinger

This commit is contained in:
Mouse Reeve
2020-11-01 10:42:48 -08:00
parent 29094f3c3f
commit 203a0a25eb
4 changed files with 23 additions and 14 deletions

View File

@ -16,6 +16,7 @@ from bookwyrm.activitypub import ActivityEncoder
from bookwyrm import forms, models, books_manager
from bookwyrm import goodreads_import
from bookwyrm.tasks import app
from bookwyrm.utils import regex
def get_user_from_username(username):
@ -168,7 +169,7 @@ def search(request):
return JsonResponse([r.__dict__ for r in book_results], safe=False)
# use webfinger looks like a mastodon style account@domain.com username
if re.match(r'\w+@\w+.\w+', query):
if re.match(regex.full_username, query):
outgoing.handle_remote_webfinger(query)
# do a local user search