Skip to content

Commit

Permalink
Merge pull request #353 from CTPUG/bugs/better_slot_validation
Browse files Browse the repository at this point in the history
Protect the comparison between start_time and end_time
  • Loading branch information
drnlm committed May 3, 2017
2 parents d7d2c3f + c293cca commit aa5d7ca
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion wafer/schedule/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ def clean(self):
if not self.previous_slot and not self.start_time:
raise ValidationError("Slots must have a start time"
" or previous slot set")
if self.get_start_time() >= self.end_time:
if self.end_time and self.get_start_time() >= self.end_time:
raise ValidationError("Start time must be before end time")
# Slots should either have day + start_time, or a previous_slot, but
# not both (since previous_slot overrides the others)
Expand Down

0 comments on commit aa5d7ca

Please sign in to comment.