Skip to content

Commit

Permalink
conditional support for auto payload insertion
Browse files Browse the repository at this point in the history
  • Loading branch information
joamag committed Dec 2, 2014
1 parent 22622d3 commit 47f4b6f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/appier/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,7 @@ def __init__(
handlers = None,
service = True,
safe = False,
payload = False,
session_c = session.FileSession
):
observer.Observable.__init__(self)
Expand All @@ -236,6 +237,7 @@ def __init__(
self.parts = parts
self.service = service
self.safe = safe
self.payload = payload
self.session_c = session_c
self.description = self._description()
self.server = None
Expand Down Expand Up @@ -1015,7 +1017,7 @@ def route(self):
# filtering the ones that are not defined in the method signature
groups = match.groups()
groups = [value_t(value) for value, (value_t, _value_n) in zip(groups, param_t)]
args = list(groups) + ([payload_i] if not payload_i == None else [])
args = list(groups) + ([] if payload_i == None or not self.payload else [payload_i])
kwargs = dict([(key, value[0]) for key, value in params.items() if key in method_a or method_kw])

# in case the current route is meant to be as handled asynchronously
Expand Down

0 comments on commit 47f4b6f

Please sign in to comment.