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

Coordinators adding users that don't exist #357

Open
smartspot2 opened this issue Dec 20, 2022 · 1 comment
Open

Coordinators adding users that don't exist #357

smartspot2 opened this issue Dec 20, 2022 · 1 comment
Labels
bug Something isn't working good first issue Good for newcomers sev5 Low severity - General guidance

Comments

@smartspot2
Copy link
Member

In the coordinator view of a section, when attempting to add a student that does not exist (i.e. the user has not logged in to scheduler ever before), the backend errors on a query for the user associated on the email, giving a 500 server error, specifically when running the following line:

# check if the user can actually enroll in the section
student_user = User.objects.get(email=email)

The expected behavior is to create this user automatically in the backend, though this model creation should not happen if any other errors are present. This means that a small fix changing .get to .get_or_create is not optimal; we'd need to modify the flow slightly to incorporate this case into the feedback loop. This also means that the frontend would likely need to be modified, to display this case in the modal in the situation where other errors occur.

@smartspot2 smartspot2 added bug Something isn't working good first issue Good for newcomers labels Dec 20, 2022
@smartspot2
Copy link
Member Author

#284 has a temporary fix to this, changing the .get to a .get_or_create; this should be changed over when this issue is resolved.

@smartspot2 smartspot2 added the sev5 Low severity - General guidance label Jan 26, 2023
@joshualiao joshualiao self-assigned this Oct 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers sev5 Low severity - General guidance
Projects
None yet
Development

No branches or pull requests

2 participants