Quick hack to get /p/{url}/jstree working again
Apparently Eve is now stricter in checking against MONGO_QUERY_BLACKLIST, and blocks our use of $regex when getting child nodes. See `jstree.py::jstree_get_children()`
This commit is contained in:
parent
f6fd9228e5
commit
2ad5b20880
@ -828,3 +828,8 @@ X_DOMAINS = '*'
|
||||
X_ALLOW_CREDENTIALS = True
|
||||
X_HEADERS = 'Authorization'
|
||||
RENDERERS = ['eve.render.JSONRenderer']
|
||||
|
||||
# TODO(Sybren): this is a quick workaround to make /p/{url}/jstree work again.
|
||||
# Apparently Eve is now stricter in checking against MONGO_QUERY_BLACKLIST, and
|
||||
# blocks our use of $regex.
|
||||
MONGO_QUERY_BLACKLIST = ['$where']
|
||||
|
@ -99,3 +99,12 @@ class JSTreeTest(AbstractPillarTest):
|
||||
'children': False,
|
||||
'custom_view': False,
|
||||
})
|
||||
|
||||
def test_jstree_canary(self):
|
||||
"""Test that a project's /jstree URL can be called at all.
|
||||
|
||||
This catches a problem we had with MONGO_QUERY_BLACKLIST.
|
||||
"""
|
||||
|
||||
resp = self.get(f'/p/{self.project["url"]}/jstree')
|
||||
self.assertEqual(200, resp.status_code)
|
||||
|
Loading…
x
Reference in New Issue
Block a user