Skip to content

Commit

Permalink
Merge pull request #1 from AlmightyOatmeal/AlmightyOatmeal-patch-1
Browse files Browse the repository at this point in the history
Removed included from _get_collection_helper()
  • Loading branch information
AlmightyOatmeal authored Jul 10, 2016
2 parents ec1dd34 + b0b7d8e commit 91a2298
Showing 1 changed file with 15 additions and 12 deletions.
27 changes: 15 additions & 12 deletions flask_restless/views/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -1772,19 +1772,22 @@ def _get_collection_helper(self, resource=None, relation_name=None,
instances = resource
else:
instances = search_items
# Resolves issue #558 - This is performing a full table scan so
# break out the nuns because this is misbehaving.
#
# Include any requested resources in a compound document.
try:
included = self.get_all_inclusions(instances)
except MultipleExceptions as e:
# By the way we defined `get_all_inclusions()`, we are
# guaranteed that each of the underlying exceptions is a
# `SerializationException`. Thus we can use
# `errors_from_serialization_exception()`.
return errors_from_serialization_exceptions(e.exceptions,
included=True)
if 'included' not in result:
result['included'] = []
result['included'].extend(included)
# try:
# included = self.get_all_inclusions(instances)
# except MultipleExceptions as e:
# # By the way we defined `get_all_inclusions()`, we are
# # guaranteed that each of the underlying exceptions is a
# # `SerializationException`. Thus we can use
# # `errors_from_serialization_exception()`.
# return errors_from_serialization_exceptions(e.exceptions,
# included=True)
# if 'included' not in result:
# result['included'] = []
# result['included'].extend(included)

# This method could have been called on either a request to
# fetch a collection of resources or a to-many relation.
Expand Down

0 comments on commit 91a2298

Please sign in to comment.