Custom error pages.

These make a distinction between API requests on /api/ (which will return
a JSON response) and other requests (which will return HTML).

Fixes T49212
This commit is contained in:
2016-09-06 14:22:43 +02:00
parent e04b2ef7ea
commit ab5a4a6b6c
2 changed files with 35 additions and 1 deletions

View File

@@ -34,6 +34,8 @@ def share_node(node_id):
'node_type': 1,
'short_code': 1
})
if not node:
raise wz_exceptions.NotFound('Node %s does not exist.' % node_id)
check_permissions('nodes', node, request.method)