Skip to content

Commit

Permalink
Merge pull request #116 from omnidynmc/master
Browse files Browse the repository at this point in the history
Add support for simple parsing of paginated response
  • Loading branch information
SchrodingersGat committed Jul 11, 2022
2 parents b441780 + a5789fc commit 9ad6c41
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions inventree/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,9 @@ def list(cls, api, **kwargs):

items = []

if isinstance(response, dict) and response['results'] is not None:
response = response['results']

for data in response:
if 'pk' in data:
items.append(cls(data=data, api=api))
Expand Down

0 comments on commit 9ad6c41

Please sign in to comment.