diff --git a/app.py b/app.py index 42b5e0dfcf8..7ed863310b9 100644 --- a/app.py +++ b/app.py @@ -1965,7 +1965,7 @@ def view_program(user, id): level=int(result['level']), code=code), is_teacher=user['is_teacher'], - class_id=student_customizations['id'], + class_id=student_customizations.get('id'), next_program_id=next_program_id, next_classmate_program_id=next_classmate_adventure_id, **arguments_dict) diff --git a/templates/view-program-page.html b/templates/view-program-page.html index 9945b2c5a51..477820676f4 100644 --- a/templates/view-program-page.html +++ b/templates/view-program-page.html @@ -34,9 +34,11 @@

{{initial_adventure.name}}

{% if next_classmate_program_id %} {{ _('next_student') }} {% endif %} - - {{_('back_to_class')}} - + {% if class_id %} + + {{_('back_to_class')}} + + {% endif %} {% endif %}

{{_('level_title')}} {{level}}