Browse Source

HUE-6215 [core] PopupException should be displayed and not redirected as a 500

Romain Rigaux 8 năm trước cách đây
mục cha
commit
0c5e23e
1 tập tin đã thay đổi với 4 bổ sung1 xóa
  1. 4 1
      desktop/core/src/desktop/lib/exceptions_renderable.py

+ 4 - 1
desktop/core/src/desktop/lib/exceptions_renderable.py

@@ -58,5 +58,8 @@ class PopupException(Exception):
     if not request.ajax:
       data['request'] = request
     response = desktop.lib.django_util.render("popup_error.mako", request, data)
-    response.status_code = self.error_code
+    if self.error_code == 500 and data['is_embeddable']: # Hue 4
+      response.status_code = 200
+    else:
+      response.status_code = self.error_code
     return response