Skip to content

Commit

Permalink
Update user.py
Browse files Browse the repository at this point in the history
Added courses() method to fetch courses for a given user.  Followed teams() method conventions for consistency.
  • Loading branch information
flionetti committed Oct 8, 2020
1 parent 0fbf964 commit e00357d
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/litmos/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,16 @@ def teams(self):
)
)

def courses(self):
from litmos.course import Course
return Course._parse_response(
API.get_sub_resource(
self.__class__.name(),
self.Id,
'courses'
)
)

def set_manager(self, manager):
if type(manager)==User:
self.ManagerId = manager.Id
Expand Down

0 comments on commit e00357d

Please sign in to comment.