Fixes pagination and user links on import admin

This commit is contained in:
Mouse Reeve 2022-11-03 10:54:59 -07:00
parent 91b935bc0a
commit 0ba4dbbc6f
2 changed files with 11 additions and 2 deletions

View file

@ -43,6 +43,11 @@
<th> <th>
{% trans "Date Created" %} {% trans "Date Created" %}
</th> </th>
{% if status != "active" %}
<th>
{% trans "Date Updated" %}
</th>
{% endif %}
<th> <th>
{% trans "Items" %} {% trans "Items" %}
</th> </th>
@ -57,9 +62,12 @@
<tr> <tr>
<td>{{ import.id }}</td> <td>{{ import.id }}</td>
<td class="overflow-wrap-anywhere"> <td class="overflow-wrap-anywhere">
<a href="{% url 'settings-user' user.id %}">{{ import.user|username }}</a> <a href="{% url 'settings-user' import.user.id %}">{{ import.user|username }}</a>
</td> </td>
<td>{{ import.created_date }}</td> <td>{{ import.created_date }}</td>
{% if status != "active" %}
<td>{{ import.updated_date }}</td>
{% endif %}
<td>{{ import.item_count }}</td> <td>{{ import.item_count }}</td>
<td>{{ import.pending_item_count }}</td> <td>{{ import.pending_item_count }}</td>
{% if status == "active" %} {% if status == "active" %}
@ -81,6 +89,6 @@
</table> </table>
</div> </div>
{% include 'snippets/pagination.html' with page=users path=request.path %} {% include 'snippets/pagination.html' with page=imports path=request.path %}
{% endblock %} {% endblock %}

View file

@ -14,6 +14,7 @@ from bookwyrm.tests.validate_html import validate_html
class CeleryStatusViews(TestCase): class CeleryStatusViews(TestCase):
"""every response to a get request, html or json""" """every response to a get request, html or json"""
# pylint: disable=invalid-name
def setUp(self): def setUp(self):
"""we need basic test data and mocks""" """we need basic test data and mocks"""
self.factory = RequestFactory() self.factory = RequestFactory()