Skip to content

Commit

Permalink
Let TypeError propagate from tile functions #11805 (#11807)
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobtylerwalls authored Mar 4, 2025
1 parent d27ba10 commit 4b5e67c
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 33 deletions.
48 changes: 15 additions & 33 deletions arches/app/models/tile.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
"""
Expand All @@ -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 = []
Expand Down
1 change: 1 addition & 0 deletions releases/8.0.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,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)
- Restore support for `.create()` on Django model managers [#10958](https://github.com/archesproject/arches/issues/10958)
Expand Down

0 comments on commit 4b5e67c

Please sign in to comment.