diff --git a/invenio_records_lom/utils/metadata.py b/invenio_records_lom/utils/metadata.py index 9b6d908..04b318a 100644 --- a/invenio_records_lom/utils/metadata.py +++ b/invenio_records_lom/utils/metadata.py @@ -239,6 +239,13 @@ def append_course(self, course: LOMCourseMetadata) -> None: if course.record["course.version"] not in versions: self.record["courses"].append(course.record.data) + def get_courses(self) -> list: + """Get courses.""" + try: + return self.record["courses"] + except KeyError: + return [] + ############### # # methods for manipulating LOM's `general` (1) category