Skip to content

Commit

Permalink
metadata: add method get_courses
Browse files Browse the repository at this point in the history
  • Loading branch information
utnapischtim committed Jul 5, 2024
1 parent 5044622 commit 52938f9
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions invenio_records_lom/utils/metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 52938f9

Please sign in to comment.