Skip to content

Commit

Permalink
Fix Attribute Error in Upgrade Step 2619 (#2642)
Browse files Browse the repository at this point in the history
* Handle non existing field

* Changelog updated

* comment added
  • Loading branch information
ramonski authored Nov 11, 2024
1 parent 6f5d5ce commit ca09802
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Changelog
2.6.0 (unreleased)
------------------

- #2642 Fix Attribute Error in Upgrade Step 2619
- #2641 Fix AttributeError on rejection of samples without a contact set
- #2640 Fix missing custom transitions via adapter in Worksheet's analyses
- #2639 Fix sampletype-related indexes for AnalysisSpec type are not indexed
Expand Down
8 changes: 7 additions & 1 deletion src/senaite/core/upgrade/v02_06_000.py
Original file line number Diff line number Diff line change
Expand Up @@ -2189,7 +2189,13 @@ def setup_result_types(tool):
continue

# check if it was set as a string result
string_result = obj.getField("StringResult").get(obj)
field = obj.getField("StringResult")
if not field:
# https://github.com/senaite/senaite.core/pull/2642
logger.error("Field 'StringResult' not found on object %s (%s)"
% (api.get_path(obj), api.get_uid(obj)))
continue
string_result = field.get(obj)

# get the results options type
options_field = obj.getField("ResultOptionsType")
Expand Down

0 comments on commit ca09802

Please sign in to comment.