Skip to content

Commit

Permalink
Exclude hidden course modules in the calendar export
Browse files Browse the repository at this point in the history
  • Loading branch information
markkuriekkinen committed Apr 6, 2021
1 parent 752afbc commit 211b2b8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions course/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
from lib.viewbase import BaseTemplateView, BaseRedirectMixin, BaseFormView, BaseView, BaseRedirectView
from userprofile.viewbase import UserProfileView
from .forms import GroupsForm, GroupSelectForm
from .models import CourseInstance, Course, Enrollment
from .models import Course, CourseInstance, CourseModule, Enrollment
from .permissions import EnrollInfoVisiblePermission
from .renders import group_info_context
from .viewbase import CourseModuleBaseView, CourseInstanceMixin, EnrollableViewMixin, CourseMixin
Expand Down Expand Up @@ -223,7 +223,7 @@ def get(self, request, *args, **kwargs):
cal = icalendar.Calendar()
cal.add('prodid', '-// {} calendar //'.format(settings.BRAND_NAME))
cal.add('version', '2.0')
for module in self.instance.course_modules.all():
for module in self.instance.course_modules.exclude(status__exact=CourseModule.STATUS.HIDDEN):
event = icalendar.Event()
event.add('summary', module.name)
event.add('dtstart',
Expand Down

0 comments on commit 211b2b8

Please sign in to comment.