Skip to content

Commit

Permalink
Fix parser when entries is None
Browse files Browse the repository at this point in the history
  • Loading branch information
protoroto committed Jan 13, 2025
1 parent bc72305 commit aa748fb
Show file tree
Hide file tree
Showing 4 changed files with 843 additions and 4 deletions.
1 change: 1 addition & 0 deletions changes/169.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix parser when entries is None
10 changes: 6 additions & 4 deletions taiga/models/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,15 +104,17 @@ def _new_resource(self, **attrs):
def parse(cls, requester, entries):
"""Parse a JSON array into a list of model instances."""
result_entries = SearchableList()
for entry in entries:
result_entries.append(cls.instance.parse(requester, entry))
if entries:
for entry in entries:
result_entries.append(cls.instance.parse(requester, entry))
return result_entries

def parse_list(self, entries):
"""Parse a JSON array into a list of model instances."""
result_entries = SearchableList()
for entry in entries:
result_entries.append(self.instance.parse(self.requester, entry))
if entries:
for entry in entries:
result_entries.append(self.instance.parse(self.requester, entry))
return result_entries


Expand Down
Loading

0 comments on commit aa748fb

Please sign in to comment.