Explorar o código

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

Romain Rigaux %!s(int64=8) %!d(string=hai) anos
pai
achega
0c5e23e
Modificáronse 1 ficheiros con 4 adicións e 1 borrados
  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