Skip to content
This repository was archived by the owner on Jan 16, 2024. It is now read-only.

Commit 34b636d

Browse files
authored
Prevent Traceback in patients listing when dob is not set (#182)
1 parent 55980f4 commit 34b636d

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

bika/health/browser/patients/folder_view.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -166,10 +166,8 @@ def folderitems(self, full_objects=False, classic=False):
166166
def folderitem(self, obj, item, index):
167167
# Date of Birth
168168
dob = obj.getBirthDate
169-
item['getBirthDate'] = self.ulocalized_time(dob)
170-
171-
# Patient's current age
172-
item["age"] = get_age_ymd(dob)
169+
item['getBirthDate'] = dob and self.ulocalized_time(dob) or ""
170+
item["age"] = dob and get_age_ymd(dob) or ""
173171

174172
# make the columns patient title, patient ID and client patient ID
175173
# redirect to the Analysis Requests of the patient

0 commit comments

Comments
 (0)