Skip to content

Commit

Permalink
fixup! move logic for count, limit and offset in the end of the funct…
Browse files Browse the repository at this point in the history
…ion after all other data manipulation
  • Loading branch information
petracihalova committed Feb 7, 2024
1 parent a73433d commit 311e1ff
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions rbac/management/principal/view.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,8 @@ def get(self, request):
try:
limit = int(query_params.get("limit", default_limit))
offset = int(query_params.get("offset", 0))
if limit < 0 or offset < 0:
raise ValueError
options["limit"] = limit
options["offset"] = offset
options["sort_order"] = validate_and_get_key(query_params, SORTORDER_KEY, VALID_SORTORDER_VALUE, "asc")
Expand Down

0 comments on commit 311e1ff

Please sign in to comment.