feat: disable allowed enrollment if enrollment closed
This commit is contained in:
committed by
Piotr Surowiec
parent
d7f2b555c7
commit
99cd4a4715
@@ -534,6 +534,12 @@ class CourseOverview(TimeStampedModel):
|
||||
"""
|
||||
return course_metadata_utils.has_course_ended(self.end)
|
||||
|
||||
def is_enrollment_open(self):
|
||||
"""
|
||||
Returns True if course enrollment is open
|
||||
"""
|
||||
return course_metadata_utils.is_enrollment_open(self.enrollment_start, self.enrollment_end)
|
||||
|
||||
def has_marketing_url(self):
|
||||
"""
|
||||
Returns whether the course has marketing url.
|
||||
|
||||
@@ -141,6 +141,7 @@ class CourseOverviewTestCase(CatalogIntegrationMixin, ModuleStoreTestCase, Cache
|
||||
('clean_id', ('#',)),
|
||||
('has_ended', ()),
|
||||
('has_started', ()),
|
||||
('is_enrollment_open', ()),
|
||||
]
|
||||
for method_name, method_args in methods_to_test:
|
||||
course_value = getattr(course, method_name)(*method_args)
|
||||
|
||||
Reference in New Issue
Block a user