Commit f80152cb by Asad Azam Committed by AsadAzam

Removed start date cannot be in the past validation on course run

parent e35c51d8
...@@ -6,7 +6,6 @@ from django import forms ...@@ -6,7 +6,6 @@ from django import forms
from django.core.exceptions import ValidationError from django.core.exceptions import ValidationError
from django.db.models.functions import Lower from django.db.models.functions import Lower
from django.template.loader import render_to_string from django.template.loader import render_to_string
from django.utils import timezone
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import ugettext_lazy as _
from opaque_keys import InvalidKeyError from opaque_keys import InvalidKeyError
from opaque_keys.edx.keys import CourseKey from opaque_keys.edx.keys import CourseKey
...@@ -324,8 +323,6 @@ class CustomCourseRunForm(CourseRunForm): ...@@ -324,8 +323,6 @@ class CustomCourseRunForm(CourseRunForm):
max_effort = cleaned_data.get("max_effort") max_effort = cleaned_data.get("max_effort")
start = cleaned_data.get("start") start = cleaned_data.get("start")
end = cleaned_data.get("end") end = cleaned_data.get("end")
if start and start < timezone.now():
raise ValidationError({'start': _('Start date cannot be in the Past')})
if start and end and start > end: if start and end and start > end:
raise ValidationError({'start': _('Start date cannot be after the End date')}) raise ValidationError({'start': _('Start date cannot be after the End date')})
if min_effort and max_effort and min_effort > max_effort: if min_effort and max_effort and min_effort > max_effort:
......
...@@ -111,11 +111,6 @@ class PublisherCourseRunEditFormTests(TestCase): ...@@ -111,11 +111,6 @@ class PublisherCourseRunEditFormTests(TestCase):
with self.assertRaises(ValidationError): with self.assertRaises(ValidationError):
run_form.clean() run_form.clean()
run_form.cleaned_data = {'start': current_datetime - timedelta(days=3),
'end': current_datetime + timedelta(days=3)}
with self.assertRaises(ValidationError):
run_form.clean()
run_form.cleaned_data['start'] = current_datetime + timedelta(days=1) run_form.cleaned_data['start'] = current_datetime + timedelta(days=1)
run_form.cleaned_data['end'] = current_datetime + timedelta(days=3) run_form.cleaned_data['end'] = current_datetime + timedelta(days=3)
self.assertEqual(run_form.clean(), run_form.cleaned_data) self.assertEqual(run_form.clean(), run_form.cleaned_data)
...@@ -675,10 +675,6 @@ msgid "Video Language" ...@@ -675,10 +675,6 @@ msgid "Video Language"
msgstr "" msgstr ""
#: apps/publisher/forms.py #: apps/publisher/forms.py
msgid "Start date cannot be in the Past"
msgstr ""
#: apps/publisher/forms.py
msgid "Start date cannot be after the End date" msgid "Start date cannot be after the End date"
msgstr "" msgstr ""
......
...@@ -800,11 +800,6 @@ msgid "Video Language" ...@@ -800,11 +800,6 @@ msgid "Video Language"
msgstr "Vïdéö Längüägé Ⱡ'σяєм ιρѕυм ∂σłσя ѕιт#" msgstr "Vïdéö Längüägé Ⱡ'σяєм ιρѕυм ∂σłσя ѕιт#"
#: apps/publisher/forms.py #: apps/publisher/forms.py
msgid "Start date cannot be in the Past"
msgstr ""
"Stärt däté çännöt ßé ïn thé Päst Ⱡ'σяєм ιρѕυм ∂σłσя ѕιт αмєт, ¢σηѕє¢тє#"
#: apps/publisher/forms.py
msgid "Start date cannot be after the End date" msgid "Start date cannot be after the End date"
msgstr "" msgstr ""
"Stärt däté çännöt ßé äftér thé Énd däté Ⱡ'σяєм ιρѕυм ∂σłσя ѕιт αмєт, " "Stärt däté çännöt ßé äftér thé Énd däté Ⱡ'σяєм ιρѕυм ∂σłσя ѕιт αмєт, "
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment