-
Notifications
You must be signed in to change notification settings - Fork 745
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
Sanitize inputs to handle NULL characters when parsing a string literal #11660
Sanitize inputs to handle NULL characters when parsing a string literal #11660
Conversation
Build Artifacts
|
kolibri/core/auth/api.py
Outdated
|
||
serializer = SanitizeInputsSerializer(data=request.data) | ||
serializer.is_valid(raise_exception=True) | ||
if not serializer.is_valid(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This second validity check for the serializer can be removed. If the validation fails, it will automatically raise an exception due to serializer.is_valid(raise_exception=True)
, so the code inside this if block would not be executed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure @LianaHarris360. I'll update it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for working on this @KshitijThareja! The changes are as requested and now sanitize and validate the inputs before checking if the username already exists.
6336620
into
learningequality:release-v0.16.x
Thanks @LianaHarris360. I'm glad that the changes were as expected and helped solve the issue 😃 |
Summary
This PR aims to sanitize the username and facility inputs from
Create Account
page by passing them through a serializer so as to avoid NULL characters and use the validated data from the serializer.References
#10505
Testing checklist
PR process
Reviewer checklist
yarn
andpip
)