diff --git a/SAS/TMSS/services/scheduling/lib/constraints/template_constraints_v1.py b/SAS/TMSS/services/scheduling/lib/constraints/template_constraints_v1.py index c49cfddb7f2a71d76b67176682d7d55dd856cf02..1a4b74c94c386a713fc815eff3d66eda9ac2d008 100644 --- a/SAS/TMSS/services/scheduling/lib/constraints/template_constraints_v1.py +++ b/SAS/TMSS/services/scheduling/lib/constraints/template_constraints_v1.py @@ -109,6 +109,10 @@ def can_run_within_timewindow_with_time_constraints(scheduling_unit: models.Sche '''evaluate the time contraint(s)''' constraints = scheduling_unit.draft.scheduling_constraints_doc # TODO: TMSS-244 (and more?), evaluate the constraints in constraints['time'] + if has_manual_scheduler_constraint(scheduling_unit): + at = parser.parse(constraints['time']['at'], ignoretz=True) + return at >= lower_bound and at+scheduling_unit.duration <= upper_bound + if 'before' in constraints['time']: before = parser.parse(constraints['time']['before'], ignoretz=True) return before <= upper_bound-scheduling_unit.duration @@ -136,6 +140,10 @@ def get_earliest_possible_start_time(scheduling_unit: models.SchedulingUnitBluep constraints = scheduling_unit.draft.scheduling_constraints_doc try: + if has_manual_scheduler_constraint(scheduling_unit): + at = parser.parse(constraints['time']['at'], ignoretz=True) + return at + if 'after' in constraints['time']: return parser.parse(constraints['time']['after'], ignoretz=True)