Skip to content

Commit 343a277

Browse files
committed
fixup! base_rest: turn off deprecation logging on demand
1 parent d689ffd commit 343a277

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

base_rest/components/service.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -145,15 +145,16 @@ def _prepare_response(self, method, result):
145145
return result
146146
routing = getattr(method, ROUTING_DECORATOR_ATTR, None)
147147
output_param = routing["output_param"]
148-
if not output_param and not DISABLE_DEPRECATE_LOG:
148+
if output_param:
149+
return output_param.to_response(self, result)
150+
elif not output_param and not DISABLE_DEPRECATE_LOG:
149151
_logger.warning(
150152
"DEPRECATED: You must define an output schema for method %s "
151153
"in service %s",
152154
method_name,
153155
self._name,
154156
)
155-
return result
156-
return output_param.to_response(self, result)
157+
return result
157158

158159
def dispatch(self, method_name, *args, params=None):
159160
"""

0 commit comments

Comments
 (0)