If the value is a platypush Message, then converting it into a string would result in a JSON dumps that might break the interpreter (e.g. 'null' is a valid JSON keyword but it's not recognized by Python). Therefore first parse the variable from JSON
This commit is contained in:
parent
850a4f2146
commit
c867a21104
1 changed files with 2 additions and 0 deletions
|
@ -101,6 +101,8 @@ class Request(Message):
|
|||
@classmethod
|
||||
def expand_value_from_context(cls, value, **context):
|
||||
for (k, v) in context.items():
|
||||
if isinstance(v, Message):
|
||||
v = json.loads(str(v))
|
||||
exec('{}={}'.format(k, v))
|
||||
|
||||
parsed_value = ''
|
||||
|
|
Loading…
Reference in a new issue