Be less aggressive when validating schedule edit form POST
Somehow deletions were requested for shifts which didn't exist...not sure how that happened but let's just ignore instead of raise error
This commit is contained in:
parent
080e3080af
commit
6b11eb84ea
|
@ -83,10 +83,10 @@ class ScheduleView(TimeSheetView):
|
|||
# apply delete operations
|
||||
deleted = []
|
||||
for uuid, value in data['delete'].iteritems():
|
||||
assert value == 'delete'
|
||||
shift = Session.query(model.ScheduledShift).get(uuid)
|
||||
assert shift
|
||||
Session.delete(shift)
|
||||
if value == 'delete':
|
||||
shift = self.Session.query(model.ScheduledShift).get(uuid)
|
||||
if shift:
|
||||
self.Session.delete(shift)
|
||||
deleted.append(uuid)
|
||||
|
||||
# apply create / update operations
|
||||
|
|
Loading…
Reference in a new issue