File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -900,14 +900,19 @@ def course_calendar_ics(course):
900900
901901 logger .error ("There was an error rendering url %s for course '%s'" , request .path , course .slug )
902902 logger .exception (e )
903- return render_template (
903+ error_html = render_template (
904904 "error_in_fork.html" ,
905905 malfunctioning_course = course ,
906906 edit_info = get_edit_info (course .edit_path ),
907907 faulty_page = "calendar" ,
908908 root_slug = model .meta .slug ,
909909 travis_build_id = os .environ .get ("TRAVIS_BUILD_ID" ),
910910 )
911+ # XXX: Hack for static site generation -- the .ics extension
912+ # means the error page is served as text/calendar. There's
913+ # no good way to make an actual calendar show an error.
914+ # https://github.com/pyvec/naucse.python.cz/issues/424
915+ return Response (error_html , mimetype = "text/calendar" )
911916 else :
912917 try :
913918 calendar = generate_calendar_ics (course )
You can’t perform that action at this time.
0 commit comments