Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Let TypeError propagate from tile functions #11805 #11807

Merged
merged 1 commit into from
Mar 4, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -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)
Expand Down