Skip to content

Commit

Permalink
Check that starting and ending times are not None
Browse files Browse the repository at this point in the history
Closes #1174.
  • Loading branch information
lainets authored and markkuriekkinen committed May 30, 2023
1 parent 2d74071 commit 4db0acb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion course/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -707,7 +707,7 @@ def clean(self):
errors['instance_name'] = format_lazy(_('COURSE_INSTANCE_ERROR_INSTANCE_NAME -- {}'), self.instance_name)
if self.url in RESERVED:
errors['url'] = format_lazy(_('COURSE_INSTANCE_ERROR_URL -- {}'), self.url)
if self.ending_time <= self.starting_time:
if self.ending_time and self.starting_time and self.ending_time <= self.starting_time:
errors['ending_time'] = _('COURSE_INSTANCE_ERROR_ENDING_TIME_BEFORE_STARTING')
if self.lifesupport_time and self.lifesupport_time < self.ending_time:
errors['lifesupport_time'] = _('COURSE_INSTANCE_ERROR_LIFESUPPORT_TIME_BEFORE_ENDING')
Expand Down

0 comments on commit 4db0acb

Please sign in to comment.