fix: '<' not supported between instances of 'str' and 'NoneType' (#19553)

This commit is contained in:
rohitwaghchaure 2019-11-12 18:20:07 +05:30 committed by Nabin Hait
parent 4fa6194009
commit 010714757c

View File

@ -188,6 +188,8 @@ class Timesheet(Document):
}, as_dict=True)
# check internal overlap
for time_log in self.time_logs:
if not (time_log.from_time or time_log.to_time): continue
if (fieldname != 'workstation' or args.get(fieldname) == time_log.get(fieldname)) and \
args.idx != time_log.idx and ((args.from_time > time_log.from_time and args.from_time < time_log.to_time) or
(args.to_time > time_log.from_time and args.to_time < time_log.to_time) or