From 2e761c514d2011f8f5bff9126eedf265a421a726 Mon Sep 17 00:00:00 2001 From: Minit Date: Sun, 26 Apr 2026 15:31:28 +0530 Subject: [PATCH] fix: return response instead of exc in dispatch() error handlers All base view dispatch() methods were calling handle_exception(exc) to build a proper HTTP response but then returning the raw exception object instead of the computed response variable. Fix applied across all four base view files (app, api, license, space). --- apps/api/plane/api/views/base.py | 2 +- apps/api/plane/app/views/base.py | 4 ++-- apps/api/plane/license/api/views/base.py | 2 +- apps/api/plane/space/views/base.py | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/apps/api/plane/api/views/base.py b/apps/api/plane/api/views/base.py index fc65e7abdcf..22a23921be9 100644 --- a/apps/api/plane/api/views/base.py +++ b/apps/api/plane/api/views/base.py @@ -123,7 +123,7 @@ def dispatch(self, request, *args, **kwargs): return response except Exception as exc: response = self.handle_exception(exc) - return exc + return response def finalize_response(self, request, response, *args, **kwargs): # Call super to get the default response diff --git a/apps/api/plane/app/views/base.py b/apps/api/plane/app/views/base.py index db5469de585..798845b22b3 100644 --- a/apps/api/plane/app/views/base.py +++ b/apps/api/plane/app/views/base.py @@ -120,7 +120,7 @@ def dispatch(self, request, *args, **kwargs): return response except Exception as exc: response = self.handle_exception(exc) - return exc + return response @property def workspace_slug(self): @@ -215,7 +215,7 @@ def dispatch(self, request, *args, **kwargs): except Exception as exc: response = self.handle_exception(exc) - return exc + return response @property def workspace_slug(self): diff --git a/apps/api/plane/license/api/views/base.py b/apps/api/plane/license/api/views/base.py index 8d0d39ac387..ea404dd4f3b 100644 --- a/apps/api/plane/license/api/views/base.py +++ b/apps/api/plane/license/api/views/base.py @@ -106,7 +106,7 @@ def dispatch(self, request, *args, **kwargs): except Exception as exc: response = self.handle_exception(exc) - return exc + return response @property def fields(self): diff --git a/apps/api/plane/space/views/base.py b/apps/api/plane/space/views/base.py index cf8cdbdc5c9..fea0a873d99 100644 --- a/apps/api/plane/space/views/base.py +++ b/apps/api/plane/space/views/base.py @@ -114,7 +114,7 @@ def dispatch(self, request, *args, **kwargs): return response except Exception as exc: response = self.handle_exception(exc) - return exc + return response @property def workspace_slug(self): @@ -197,7 +197,7 @@ def dispatch(self, request, *args, **kwargs): except Exception as exc: response = self.handle_exception(exc) - return exc + return response @property def workspace_slug(self):