Skip to content

Navigating to "Edit Course" --> "Instances" throws error #1473

@murhum1

Description

@murhum1

Navigating to "Edit Course" --> "Instances" throws an error in cases where SIS enrollment is enabled, but the course doesn't have an instance in SIS. This generates unnecessary error emails that do not require admin intervention.

The exception is thrown in

def set_sis_selector(self) -> None:
sis: StudentInfoSystem = get_sis_configuration()
if not sis:
# Student Info System not configured
return
try:
instances = sis.get_instances(self.instance.course.code)
# If there are no SIS instances by this course code, don't show menu or checkbox
if instances:
options = [('none', '---------')] + instances
self.fields['sis'] = forms.ChoiceField(
choices=options,
label=_('LABEL_SIS_INSTANCE'),
help_text=_('LABEL_SIS_INSTANCE_HELPTEXT'),
)
self.fields['sis_enroll'] = forms.BooleanField(
label=_('LABEL_SIS_ENROLL'),
help_text=_('LABEL_SIS_ENROLL_HELPTEXT'),
required=False,
initial=False,
)
except Exception:
logger.exception("Error getting instances from SIS.")
. There should probably be a way of handling specific HTTP error codes - e.g. 404 in this case - in sis.get_instances code.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions