Skip to content

Commit

Permalink
Make cancelled field for staff hours optional; parse to False if fiel…
Browse files Browse the repository at this point in the history
…d not included.
  • Loading branch information
bzh-bzh committed Sep 22, 2019
1 parent b027d22 commit 863fa6e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion ocflib/lab/staff_hours.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ def position(uid):
continue

for staff_hour in staff_hours['staff-hours'][day]:
cancelled = False
if 'cancelled' in staff_hour.keys():
cancelled = staff_hour['cancelled']

staff_hour_list.append(
Hour(
day=day,
Expand All @@ -64,7 +68,7 @@ def position(uid):
position=position(attrs['uid'][0]),
) for attrs in map(user_attrs, staff_hour['staff'])
],
cancelled=staff_hour['cancelled'],
cancelled=cancelled
)
)

Expand Down

0 comments on commit 863fa6e

Please sign in to comment.