feat: Validate country input during student registration#37719
feat: Validate country input during student registration#37719Waleed-Mujahid wants to merge 2 commits into
Conversation
|
@mphilbrick211 Hey can you look into this PR and the linked issue |
|
Hi @Waleed-Mujahid! Is this currently for a product proposal that's in progress? It might be that the Product team has not had a chance to review yet. |
b04edbc to
2d03325
Compare
Added validation to ensure that the country code provided during student registration is valid. If the country code is invalid, an error message is appended to the row errors for appropriate feedback.
2d03325 to
f7bca07
Compare
|
@mphilbrick211 hey the product review is complete. Can you ask someone to review this? |
|
I agree with this change. Also commented with my approval on related issue: openedx/platform-roadmap#487 |
| cohort_name = None | ||
| course_mode = None | ||
|
|
||
| if not Country(country).name: |
There was a problem hiding this comment.
We're not eliminating spaces in the country; something like " US" is failing.
| if not Country(country).name: | |
| if not Country(country.strip()).name: |
| cohort_name = None | ||
| course_mode = None | ||
|
|
||
| if not Country(country).name: |
There was a problem hiding this comment.
Before these changes, for an existing user (only for enrollment), the country column wasn't used. But now it's checked, and this can generate errors. Can you only perform this check for new users? This would make it backward compatible.
|
Hi @Waleed-Mujahid, nice work! I've left some comments. Thanks! |

Description
While using the CSV enroll option in LMS instructor tab if an instructor use full country name instead ISO country code a general DataError is raised which can be confusing for instructors.
Roadmap
openedx/platform-roadmap#487
Before
After
Testing instructions
ALLOW_AUTOMATED_SIGNUPSas True in site configurationsNon-ISOcode formatDataError