Skip to content

Commit

Permalink
Merge pull request #38 from PnX-SI/fix/limit
Browse files Browse the repository at this point in the history
fix limit not set
  • Loading branch information
TheoLechemia authored Aug 8, 2023
2 parents 71fbdbe + e461ccf commit ec73a5b
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/utils_flask_sqla/generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,6 @@ def build_query_filters(self, query, parameters):
"""
for f in parameters:
query = self.build_query_filter(query, f, parameters.get(f))

return query

def build_query_filter(self, query, param_name, param_value):
Expand Down Expand Up @@ -248,13 +247,12 @@ def raw_query(self, process_filter=True):

if not process_filter:
return q

if self.filters:
unordered_q = self.build_query_filters(q, self.filters)
q = self.build_query_order(unordered_q, self.filters)

if self.limit != -1:
q.limit(self.limit).offset(self.offset * self.limit)
q = q.limit(self.limit).offset(self.offset * self.limit)

return q

Expand Down

0 comments on commit ec73a5b

Please sign in to comment.