Fix: “Show all” table pagination (#3946)

Co-authored-by: Vlad Stan <stan.v.vlad@gmail.com>
This commit is contained in:
Tiago Vasconcelos
2026-05-07 12:02:19 +03:00
committed by GitHub
co-authored by Vlad Stan
parent 93dc10fe94
commit 9edc4786e1
2 changed files with 70 additions and 14 deletions
+4 -2
View File
@@ -35,7 +35,7 @@ if settings.lnbits_database_url:
else:
if not database_uri.startswith("postgres://"):
raise ValueError(
"Please use the 'postgres://...' " "format for the database URL."
"Please use the 'postgres://...' format for the database URL."
)
DB_TYPE = POSTGRES
@@ -560,7 +560,9 @@ class Filters(BaseModel, Generic[TFilterModel]):
def pagination(self) -> str:
stmt = ""
self.limit = self.limit or 10
if self.limit == 0:
self.limit = 1000
self.limit = 10 if self.limit is None else self.limit
stmt += f"LIMIT {min(1000, self.limit)} "
if self.offset:
stmt += f"OFFSET {self.offset}"