Compare commits

...
Author SHA1 Message Date
imperosol 8175fc415c add a space between inputs and submit in refill form 2026-09-20 22:37:31 +02:00
thomas girod 994130550a Merge pull request #1492 from ae-utbm/fix-pagination
fix: broken matmat pagination
2026-09-20 22:28:48 +02:00
imperosol 44071f91f6 fix: broken matmat pagination 2026-09-20 22:26:27 +02:00
5 changed files with 16 additions and 6 deletions
@@ -62,8 +62,7 @@
}
form {
margin-top: .5rem;
margin-bottom: .5rem;
margin: 0;
}
}
@@ -4,6 +4,8 @@
hx-swap="outerHTML"
>
{% csrf_token %}
{{ form.as_p() }}
<input type="submit" value="{% trans %}Go{% endtrans %}"/>
<div class="margin-bottom">
{{ form.as_p() }}
</div>
<input type="submit" class="btn btn-blue" value="{% trans %}Go{% endtrans %}"/>
</form>
+1 -1
View File
@@ -25,7 +25,7 @@
{% endfor %}
</div>
{% if page_obj.has_other_pages() %}
{{ paginate_htmx(page_obj, paginator) }}
{{ paginate_htmx(request, page_obj, paginator) }}
{% endif %}
<hr>
{% endif %}
+10
View File
@@ -58,3 +58,13 @@ class TestMatmatronch(TestCase):
assert list(response.context_data["object_list"]) == []
assert not response.context_data["form"].is_valid()
assert "Recherche vide" in response.context_data["form"].non_field_errors()
def test_search_many_users(self):
"""Test that the pagination works when a lot of users are returned."""
baker.make(User, promo=17, _quantity=40, _bulk_create=True)
self.client.force_login(subscriber_user.make())
response = self.client.get(reverse("matmat:search", query={"promo": 17}))
assert response.status_code == 200
assert response.context_data["paginator"].count == 43
assert response.context_data["paginator"].num_pages == 3
-1
View File
@@ -20,7 +20,6 @@
# Place - Suite 330, Boston, MA 02111-1307, USA.
#
#
from django.db.models import F
from django.views.generic import ListView
from django.views.generic.edit import FormMixin