Skip to content

Commit

Permalink
Fix Traceback when using reaodnly_transaction decorator for objects w…
Browse files Browse the repository at this point in the history
…ith no __name__ (senaite#2143)

* Fix Traceback when using decorator for objects with no __name__

* Changelog
  • Loading branch information
xispa authored Sep 26, 2022
1 parent 1713351 commit eef5950
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ Changelog
2.3.0 (unreleased)
------------------

- #2143 Fix Traceback when using readonly decorator for objects w/o __name__
- #2140 Allow to enable/disable analysis categories for samples
- #2137 Dynamic Workflow Menu
- #2139 Fix LabClerk cannot create partitions from received samples
Expand Down
2 changes: 1 addition & 1 deletion src/senaite/core/decorators/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def readonly_transaction(func):
@wraps(func)
def decorator(self, *args, **kwargs):
logger.info("*** READONLY TRANSACTION: '{}.{}' ***".
format(self.__class__.__name__, self.__name__))
format(self.__class__.__name__, func.__name__))
tx = transaction.get()
tx.doom()
return func(self, *args, **kwargs)
Expand Down

0 comments on commit eef5950

Please sign in to comment.