diff --git a/bookwyrm/outgoing.py b/bookwyrm/outgoing.py index 9d894a26b..d12a0430a 100644 --- a/bookwyrm/outgoing.py +++ b/bookwyrm/outgoing.py @@ -43,7 +43,10 @@ def handle_account_search(query): except models.User.DoesNotExist: url = 'https://%s/.well-known/webfinger?resource=acct:%s' % \ (domain, query) - response = requests.get(url) + try: + response = requests.get(url) + except requests.exceptions.ConnectionError: + return None if not response.ok: response.raise_for_status() data = response.json() @@ -52,8 +55,8 @@ def handle_account_search(query): try: user = get_or_create_remote_user(link['href']) except KeyError: - return HttpResponseNotFound() - return user + return None + return [user] def handle_follow(user, to_follow): diff --git a/bookwyrm/templates/user_results.html b/bookwyrm/templates/user_results.html index 5c48d850c..94f8a82e0 100644 --- a/bookwyrm/templates/user_results.html +++ b/bookwyrm/templates/user_results.html @@ -1,6 +1,9 @@ {% extends 'layout.html' %} {% block content %}
No results found for "{{ query }}"
+ {% endif %} {% for result in results %}