Cannot print individual courses #604
-
While trying to print an individual course from the PaginatedList of course, I am getting the error: I have my API_URL and API_KEY but do not want to show in the code.
I am wondering if anyone knows how to fix this problem. I am following the ucfopen README but their code for going over a PaginatedList of courses doesn't work for me. Thanks. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
That's a strange bug - when you try to print the I'll get a PR up tomorrow to fix it, but in the meantime, you can do this: canvas = Canvas(API_URL, API_KEY)
user = canvas.get_current_user()
courses = user.get_courses()
for course in courses:
print(course.name, course.id) That'll let you find the course you need along with its ID. |
Beta Was this translation helpful? Give feedback.
Ah, that makes sense. I knew Canvas would restrict access to courses, but I didn't know it didn't send any information if it was restricted.
I'm pretty sure using the
enrollment_state
keyword argument will filter out classes you don't have access to any more because of date limits:If that doesn't work, you can try the
state="active"
argument.