This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from datetime import datetime | |
| def break_duration(work_report): | |
| total = total_duration(work_report) | |
| if total is None: | |
| return None | |
| if None in (work_report.start_time, work_report.end_time): | |
| return 0.0 | |
| return total - float(work_report.amount) |