소스 검색

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

Romain Rigaux 8 년 전
부모
커밋
0c5e23e
1개의 변경된 파일4개의 추가작업 그리고 1개의 파일을 삭제
  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