forked from mirrors/bookwyrm
Handle user search 404s
This commit is contained in:
parent
8dba4ccf47
commit
2b710c44e4
2 changed files with 6 additions and 4 deletions
|
@ -48,7 +48,7 @@ def handle_account_search(query):
|
||||||
except requests.exceptions.ConnectionError:
|
except requests.exceptions.ConnectionError:
|
||||||
return None
|
return None
|
||||||
if not response.ok:
|
if not response.ok:
|
||||||
response.raise_for_status()
|
return None
|
||||||
data = response.json()
|
data = response.json()
|
||||||
for link in data['links']:
|
for link in data['links']:
|
||||||
if link['rel'] == 'self':
|
if link['rel'] == 'self':
|
||||||
|
|
|
@ -1,12 +1,14 @@
|
||||||
{% extends 'layout.html' %}
|
{% extends 'layout.html' %}
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<div class="content-container">
|
<div class="block">
|
||||||
|
<h2 class="title">User search results</h2>
|
||||||
{% if not results %}
|
{% if not results %}
|
||||||
<p>No results found for "{{ query }}"</p>
|
<p>No results found for "{{ query }}"</p>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% for result in results %}
|
{% for result in results %}
|
||||||
<div>
|
<div class="block">
|
||||||
<h2>{{ result.username }}</h2>
|
{% include 'snippets/avatar.html' with user=result %}</h2>
|
||||||
|
{% include 'snippets/username.html' with user=result show_full=True %}</h2>
|
||||||
{% include 'snippets/follow_button.html' with user=result %}
|
{% include 'snippets/follow_button.html' with user=result %}
|
||||||
</div>
|
</div>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
Loading…
Reference in a new issue