mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
fix(routers.accounts): correct disable decision for More button
Signed-off-by: Kevin Morris <kevr@0cost.org>
This commit is contained in:
parent
2baf061b96
commit
b27dab99d8
2 changed files with 6 additions and 5 deletions
|
@ -529,7 +529,6 @@ async def accounts_post(request: Request,
|
|||
# Get a query handle to users, populate the total user
|
||||
# count into a jinja2 context variable.
|
||||
query = db.query(models.User).join(models.AccountType)
|
||||
context["total_users"] = query.count()
|
||||
|
||||
# Populate this list with any additional statements to
|
||||
# be ANDed together.
|
||||
|
@ -551,8 +550,10 @@ async def accounts_post(request: Request,
|
|||
if statements:
|
||||
query = query.filter(and_(*statements))
|
||||
|
||||
context["total_users"] = query.count()
|
||||
|
||||
# Finally, order and truncate our users for the current page.
|
||||
users = query.order_by(*order_by).limit(pp).offset(offset)
|
||||
users = query.order_by(*order_by).limit(pp).offset(offset).all()
|
||||
context["users"] = util.apply_all(users, db.refresh)
|
||||
|
||||
return render_template(request, "account/index.html", context)
|
||||
|
|
|
@ -64,11 +64,11 @@
|
|||
<input type="hidden" name="O"
|
||||
value="{{ offset + pp }}" />
|
||||
{% for k, v in params.items() %}
|
||||
<input type="hidden" name="{{ k }}"
|
||||
value="{{ v }}" />
|
||||
<input type="hidden" name="{{ k }}" value="{{ v }}" />
|
||||
{% endfor %}
|
||||
|
||||
<button type="submit" class="button page-next"
|
||||
{% if offset + pp >= total_users %}
|
||||
{% if (offset + pp) >= total_users %}
|
||||
disabled
|
||||
{% endif %}
|
||||
>
|
||||
|
|
Loading…
Add table
Reference in a new issue