Skip to content

Commit 61f5dbe

Browse files
authored
Merge pull request #475 from senaite/bugfix/issue-474-traceback-on-add-analyses
Issue-474: Fixed AttributeError on WS Analyses assignment
2 parents 414078d + 7b603c4 commit 61f5dbe

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

CHANGES.rst

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ Changelog
1818

1919
**Fixed**
2020

21+
- #475 Assigning Analyses to a WS raises AttributeError
2122
- #466 UnicodeDecodeError if unicode characters are entered into the title field
2223
- #453 Sample points do not show the referenced sample types in view
2324
- #470 Sort order of Analyses in WS print view wrong

bika/lims/content/abstractanalysis.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -992,7 +992,7 @@ def getAnalyst(self):
992992
# Is assigned to a worksheet?
993993
wss = self.getBackReferences('WorksheetAnalysis')
994994
if len(wss) > 0:
995-
analyst = wss[0].getAnalyst().getUsername()
995+
analyst = wss[0].getAnalyst()
996996
field.set(self, analyst)
997997
return analyst if analyst else ''
998998

bika/lims/tests/test_duplicate-analysis.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ def test_LIMS2001(self):
7272
lab_contact = [o for o in lab_contacts if o.getUsername() == 'analyst1']
7373
self.assertEquals(len(lab_contact), 1)
7474
lab_contact = lab_contact[0]
75-
ws.setAnalyst(lab_contact)
75+
ws.setAnalyst(lab_contact.getUsername())
7676
ws.setResultsLayout(self.portal.bika_setup.getWorksheetLayout())
7777
# Add analyses into the worksheet
7878
self.request['context_uid'] = ws.UID()

0 commit comments

Comments
 (0)