Fix tasks page showing only 20 tasks when filters are set to 'All'

When no filters are active (status, priority, project, assigned_to, search, or overdue), the tasks page now displays all tasks instead of limiting to 20 per page. When filters are active, pagination remains at 20 items per page for better performance.

This fixes the issue where users expected to see all tasks when filters were set to 'All' but only saw the first 20 tasks.
This commit is contained in:
Dries Peeters
2025-11-06 10:32:46 +01:00
parent 8322c73ddc
commit b157855781
+11 -1
View File
@@ -67,9 +67,19 @@ def list_tasks():
)
)
# Check if any filters are active
has_filters = bool(status or priority or project_id or assigned_to or search or overdue)
# If no filters are active, show all tasks; otherwise use pagination
if has_filters:
per_page = 20
else:
# Use a very large number to effectively show all tasks
per_page = 10000
tasks = query.order_by(Task.priority.desc(), Task.due_date.asc(), Task.created_at.asc()).paginate(
page=page,
per_page=20,
per_page=per_page,
error_out=False
)