Skip to content

Commit affdaca

Browse files
committed
fix(hooks): updated_keys
Previously updated_keys mistakenly attempt to get the value from `__updateKeys` of request, but actually the request sent by API uses `_updatedKeys`.
1 parent dfce76d commit affdaca

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

leancloud/engine/leanengine.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -264,8 +264,8 @@ def dispatch_cloud_hook(_cloud_codes, app_params, class_name, hook_name, params)
264264
obj = leancloud.Object.create(class_name)
265265
obj._update_data(params['object'])
266266

267-
if '__updateKeys' in params['object']:
268-
obj.updated_keys = params['object']['__updateKeys']
267+
if '_updatedKeys' in params['object']:
268+
obj.updated_keys = params['object']['_updatedKeys']
269269

270270
if hook_name.startswith('__before'):
271271
if obj.has('__before'):

tests/test_engine.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,7 @@ def before_hook_object_update(obj):
394394
assert obj.updated_keys == ['clientValue']
395395

396396
response = requests.post(url + '/__engine/1/functions/HookObject/beforeUpdate', json={
397-
'object': {'clientValue': 'blah', '__updateKeys': ['clientValue']}
397+
'object': {'clientValue': 'blah', '_updatedKeys': ['clientValue']}
398398
}, headers={
399399
'x-avoscloud-application-id': TEST_APP_ID,
400400
'x-avoscloud-application-key': TEST_APP_KEY,

0 commit comments

Comments
 (0)