From bf5914a7ac1ef111aae49f13367cf9c823385fc0 Mon Sep 17 00:00:00 2001 From: Jacob Walls Date: Fri, 21 Feb 2025 14:04:17 -0500 Subject: [PATCH] Let TypeError propagate from tile functions #11805 Catching this could cause other functions to not run. --- arches/app/models/tile.py | 48 ++++++++++++--------------------------- releases/8.0.0.md | 1 + 2 files changed, 16 insertions(+), 33 deletions(-) diff --git a/arches/app/models/tile.py b/arches/app/models/tile.py index 20d5e19590..647b27c2b2 100644 --- a/arches/app/models/tile.py +++ b/arches/app/models/tile.py @@ -795,30 +795,18 @@ def __preSave(self, request=None, context=None): context -- string e.g. "copy" indicating conditions under which a resource is saved and how functions should behave. """ - try: - for function in self._getFunctionClassInstances(): - try: - function.save(self, request, context=context) - except NotImplementedError: - pass - except TypeError as e: - logger.warning( - _("No associated functions or other TypeError raised by a function") - ) - logger.warning(e) + for function in self._getFunctionClassInstances(): + try: + function.save(self, request, context=context) + except NotImplementedError: + pass def __preDelete(self, request=None): - try: - for function in self._getFunctionClassInstances(): - try: - function.delete(self, request) - except NotImplementedError: - pass - except TypeError as e: - logger.warning( - _("No associated functions or other TypeError raised by a function") - ) - logger.warning(e) + for function in self._getFunctionClassInstances(): + try: + function.delete(self, request) + except NotImplementedError: + pass def __postSave(self, request=None, context=None): """ @@ -827,17 +815,11 @@ def __postSave(self, request=None, context=None): context -- string e.g. "copy" indicating conditions under which a resource is saved and how functions should behave. """ - try: - for function in self._getFunctionClassInstances(): - try: - function.post_save(self, request, context=context) - except NotImplementedError: - pass - except TypeError as e: - logger.warning( - _("No associated functions or other TypeError raised by a function") - ) - logger.warning(e) + for function in self._getFunctionClassInstances(): + try: + function.post_save(self, request, context=context) + except NotImplementedError: + pass def _getFunctionClassInstances(self): ret = [] diff --git a/releases/8.0.0.md b/releases/8.0.0.md index 38fb8889b0..06be9406cb 100644 --- a/releases/8.0.0.md +++ b/releases/8.0.0.md @@ -26,6 +26,7 @@ Arches 8.0.0 Release Notes - Support more expressive plugin URLs [#11320](https://github.com/archesproject/arches/issues/11320) - Make node aliases not nullable [#10437](https://github.com/archesproject/arches/issues/10437) - Add alt text on image placeholder [#10455](https://github.com/archesproject/arches/issues/10455) +- Tile functions no longer catch TypeError [#11805](https://github.com/archesproject/arches/issues/11805) - Make failed login alert message dismissible [#11767](https://github.com/archesproject/arches/issues/11767) - Concepts API no longer responds with empty body for error conditions [#11519](https://github.com/archesproject/arches/issues/11519) - Removes sample index from new projects, updates test coverage behavior [#11591](https://github.com/archesproject/arches/issues/11519)