Skip to content

Commit

Permalink
Merge pull request #2 from fccn/igobranco/issues/184/courseoverview_s…
Browse files Browse the repository at this point in the history
…tart_end

fix: the start_date and end_date is no longer used on course overview
  • Loading branch information
igobranco authored Jul 1, 2024
2 parents f5b0dd4 + 00e9070 commit 29fa670
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions nau.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,13 +247,15 @@ def course_runs(self):
enrollment_end, enrollment_domain, invitation_only,
max_student_enrollments_allowed, announcement, catalog_visibility,
course_video_url, effort, self_paced,
certificate_available_date, end_date, start_date,
COALESCE(enrollment_start, start_date) as enrollment_start_or_course_start,
COALESCE(enrollment_end, end_date) as enrollment_end_or_course_end,
DATEDIFF(COALESCE(enrollment_start, start_date), NOW()) as days_to_enrollment_start,
DATEDIFF(start_date, NOW()) as days_to_course_start,
DATEDIFF(COALESCE(enrollment_end, end_date), NOW()) as days_to_enrollment_end,
DATEDIFF(end_date, NOW()) as days_to_course_end,
certificate_available_date,
end as end_date,
start as start_date,
COALESCE(enrollment_start, start) as enrollment_start_or_course_start,
COALESCE(enrollment_end, end) as enrollment_end_or_course_end,
DATEDIFF(COALESCE(enrollment_start, start), NOW()) as days_to_enrollment_start,
DATEDIFF(start, NOW()) as days_to_course_start,
DATEDIFF(COALESCE(enrollment_end, end), NOW()) as days_to_enrollment_end,
DATEDIFF(end, NOW()) as days_to_course_end,
(select count(1) from {self.edxapp_database}.student_courseenrollment sce WHERE sce.course_id = coc.id) AS enrolled_count,
(select count(1) from {self.edxapp_database}.student_courseenrollment sce WHERE sce.course_id = coc.id and sce.is_active) AS enrolled_count_active,
(select count(1) from {self.edxapp_database}.certificates_generatedcertificate cgc WHERE cgc.course_id = coc.id) AS certificates_count,
Expand Down

0 comments on commit 29fa670

Please sign in to comment.