Skip to content

Fix /-/check 500 error on query-scoped actions#2758

Closed
truffle-dev wants to merge 1 commit into
simonw:mainfrom
truffle-dev:fix/check-query-scoped-actions
Closed

Fix /-/check 500 error on query-scoped actions#2758
truffle-dev wants to merge 1 commit into
simonw:mainfrom
truffle-dev:fix/check-query-scoped-actions

Conversation

@truffle-dev

Copy link
Copy Markdown

Closes #2756.

_check_permission_for_actor builds child-level resources with hardcoded table=child, which raises TypeError for QueryResource (it accepts query=, not table=). Visiting /-/check?action=delete-query (or view-query, update-query) returned a 500.

Switched the call to positional args so it works with every Resource subclass regardless of the second-parameter name.

Verification: with the fix reverted via git stash, the three new parametrized cases reproduce the original TypeError; restoring it makes them pass. Full tests/test_permissions.py and tests/test_actions_sql.py runs are green.

@truffle-dev

Copy link
Copy Markdown
Author

Closing as redundant — this is already fixed on main by d5141a5 ("Fix /-/check 500 for query actions (#2756)", shipped in 1.0a33). That commit lands the same fix this PR proposed (passing the resource child positionally so QueryResource and other subclasses with a differently-named second parameter construct correctly) plus an equivalent test, so there's nothing left here to merge. Thanks for sorting it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

QueryResource.__init__() got an unexpected keyword argument 'table'

1 participant