Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR adds a new subcommand to the canvaslms CLI tool for enrolling users in Canvas courses. The functionality allows administrators to enroll users by specifying their Canvas ID, SIS user ID, integration ID, or email address along with their desired role.
Key changes:
- Added
enrollsubcommand with support for multiple user identifier types - Implemented user lookup by email address through Canvas accounts API
- Added role mapping for Canvas enrollment types (student, teacher, TA, observer)
| course.enroll_user(user, | ||
| enrollment_type=role) | ||
| except canvasapi.exceptions.CanvasException as err: | ||
| import pdb; pdb.set_trace() |
There was a problem hiding this comment.
Debug breakpoint should not be included in production code. Remove this line before merging.
| import pdb; pdb.set_trace() |
| params={"search_term": email} | ||
| ) | ||
| except canvasapi.exceptions.CanvasException as err: | ||
| import pdb; pdb.set_trace() |
There was a problem hiding this comment.
Debug breakpoint should not be included in production code. Remove this line before merging.
| import pdb; pdb.set_trace() |
| We want to ensure that we only have one user. | ||
| So we should have gotten a JSON list with one user. | ||
| <<get [[user]] from [[canvas]]>>= | ||
| respone_json = response.json() |
There was a problem hiding this comment.
Variable name has a typo: 'respone_json' should be 'response_json'.
| respone_json = response.json() | |
| response_json = response.json() |
| We want to ensure that we only have one user. | ||
| So we should have gotten a JSON list with one user. | ||
| <<get [[user]] from [[canvas]]>>= | ||
| respone_json = response.json() |
There was a problem hiding this comment.
Using undefined variable 'response_json' due to the typo in line 895. This will cause a NameError at runtime.
| respone_json = response.json() | |
| response_json = response.json() |
No description provided.