File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -900,14 +900,19 @@ def course_calendar_ics(course):
900
900
901
901
logger .error ("There was an error rendering url %s for course '%s'" , request .path , course .slug )
902
902
logger .exception (e )
903
- return render_template (
903
+ error_html = render_template (
904
904
"error_in_fork.html" ,
905
905
malfunctioning_course = course ,
906
906
edit_info = get_edit_info (course .edit_path ),
907
907
faulty_page = "calendar" ,
908
908
root_slug = model .meta .slug ,
909
909
travis_build_id = os .environ .get ("TRAVIS_BUILD_ID" ),
910
910
)
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" )
911
916
else :
912
917
try :
913
918
calendar = generate_calendar_ics (course )
You can’t perform that action at this time.
0 commit comments