Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New API endpoint needed to handle creating new users #2057

Open
dpaceoffice opened this issue Jan 19, 2024 · 1 comment
Open

New API endpoint needed to handle creating new users #2057

dpaceoffice opened this issue Jan 19, 2024 · 1 comment

Comments

@dpaceoffice
Copy link

We're attempting to automate roster population in Autolab for our courses, but we've encountered an issue: there's no way to use the API to create users. Initially, we were POSTing to /api/v1/courses/{course_name}/course_user_data, but this approach fails if the user doesn't already exist, as it won't create a non-existent user the way the user model's function, self.roster_create, does when rosters are uploaded via the GUI.

Therefore, we either need an endpoint for user management (/api/v1/user_controller) capable of more than just retrieval - specifically, one that can create, update, and destroy users. Alternatively, we could modify /api/v1/courses/{course_name}/course_user_data to call the user's self.roster_create function, rather than merely reporting that a user doesn't exist.

@damianhxy
Copy link
Member

Thanks for this feature request and we'll take a look into it!

As a workaround in the meantime, if your script has access to the Autolab instance, you could consider using the rake task rake admin:create_user[email,password,first_name,last_name] to create missing users programmatically

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants