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

PR 2271- Setting 2 or more CCContacts in AR view produces a Traceback on Save #280

Merged
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
2 changes: 1 addition & 1 deletion CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ LIMS-1504: Calculation formula test widgets

**Fixed**


- #280 Integration of PR-2271.Setting 2 or more CCContacts in AR view produces a Traceback on Save
**Security**


Expand Down
11 changes: 8 additions & 3 deletions bika/lims/browser/header_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,14 @@ def __call__(self):
for field in fields:
fieldname = field.getName()
if fieldname in form:
if fieldname + "_uid" in form:
# references (process_form would normally do *_uid trick)
field.getMutator(self.context)(form[fieldname + "_uid"])
# Handle (multiValued) reference fields
# https://github.com/bikalims/bika.lims/issues/2270
uid_fieldname = "{}_uid".format(fieldname)
if uid_fieldname in form:
value = form[uid_fieldname]
if field.multiValued:
value = value.split(",")
field.getMutator(self.context)(value)
else:
# other fields
field.getMutator(self.context)(form[fieldname])
Expand Down