Skip to content

Commit

Permalink
Simplifying yield result for collections.
Browse files Browse the repository at this point in the history
  • Loading branch information
grahamu committed May 13, 2016
1 parent 4ba2a87 commit d1339c1
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions pinax/api/viewsets.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,11 +140,7 @@ def validate(self, resource_class, collection=False, obj=None):

try:
if collection:
def gen_func():
for resource_data in data["data"]:
yield self.validate_resource(resource_class, resource_data, obj)

yield gen_func
yield (self.validate_resource(resource_class, resource_data, obj) for resource_data in data["data"])
else:
yield self.validate_resource(resource_class, data["data"], obj)
except ValidationError as exc:
Expand Down

0 comments on commit d1339c1

Please sign in to comment.