Expected Behavior
If a resource has a url and item_lookup that matches the following:
"url": "user/<regex('[a-f0-9]{24}'):_id>/tasks",
"item_lookup": False,
The pre_event hook should provide lookup as the following
def pre_GET_tasks(request, lookup):
print(lookup)
{'_id': '5ce302e4ef986650a11340fd'}
Actual Behavior
Instead lookup is empty.
I noticed that in the pre_event decorator this issue is solved by combining args with kwargs
combined_args = kwargs
if len(args) > 1:
combined_args.update(args[1].items())
Is there a reason why this bit of code is not moved to the top of the function and the combined_args passed to the pre_event hooks instead of kwargs?
Environment
- Python version: 3.6
- Eve version: 0.9.1
Expected Behavior
If a resource has a url and item_lookup that matches the following:
The pre_event hook should provide lookup as the following
Actual Behavior
Instead lookup is empty.
I noticed that in the pre_event decorator this issue is solved by combining args with kwargs
Is there a reason why this bit of code is not moved to the top of the function and the combined_args passed to the pre_event hooks instead of kwargs?
Environment