[editor] Avoid 500 error when opening a non existing saved query
@@ -53,7 +53,10 @@ def check_editor_access_permission():
pass
else:
if editor_id: # Open existing saved editor document
+ try:
editor_type = _get_editor_type(editor_id)
+ except Document2.DoesNotExist:
+ raise PopupException(_('Query id %s can not be found, please open a new editor') % editor_id)
if check_permissions(request.user, editor_type):
raise PopupException(_('Missing permission to access the %s Editor' % editor_type), error_code=401)
