Skip to content
Snippets Groups Projects
Commit c72397bf authored by Jorrit Schaap's avatar Jorrit Schaap
Browse files

TMSS-190: parse/use 'time.at'

parent ddb4c6e8
No related branches found
No related tags found
1 merge request!252Resolve TMSS-190
......@@ -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)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment