diff --git a/tornado_restless/handler.py b/tornado_restless/handler.py index 844f50d..65877a4 100644 --- a/tornado_restless/handler.py +++ b/tornado_restless/handler.py @@ -244,7 +244,8 @@ def patch(self, instance_id: str=None): result = self.patch_single(self.parse_pk(instance_id)) self._call_postprocessor(result=result) - self.finish(result) + if not self._finished: + self.finish(result) def patch_many(self) -> dict: """ @@ -364,7 +365,8 @@ def delete(self, instance_id: str=None): result = self.delete_single(self.parse_pk(instance_id)) self._call_postprocessor(result=result) - self.finish(result) + if not self._finished: + self.finish(result) def delete_many(self) -> dict: """ @@ -455,7 +457,8 @@ def put(self, instance_id: str=None): result = self.put_single(self.parse_pk(instance_id)) self._call_postprocessor(result=result) - self.finish(result) + if not self._finished: + self.finish(result) put_many = patch_many put_single = patch_single @@ -480,7 +483,8 @@ def post(self, instance_id: str=None): result = self.post_single() self._call_postprocessor(result=result) - self.finish(result) + if not self._finished: + self.finish(result) def post_single(self): """ @@ -691,7 +695,8 @@ def get(self, instance_id: str=None): result = self.get_single(self.parse_pk(instance_id)) self._call_postprocessor(result=result) - self.finish(result) + if not self._finished: + self.finish(result) def get_single(self, instance_id: list) -> dict: """