-
Notifications
You must be signed in to change notification settings - Fork 16
fix: Retired author username not being fetched #236
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
Conversation
This PR fixes the Content Serializer class not being able to fetch username of a retired author by adding a author_username property to the Content MySQL model.
|
Thanks for the pull request, @taimoor-ahmed-1! This repository is currently maintained by Once you've gone through the following steps feel free to tag them in a comment and let them know that your changes are ready for engineering review. 🔘 Get product approvalIf you haven't already, check this list to see if your contribution needs to go through the product review process.
🔘 Provide contextTo help your reviewers and other members of the community understand the purpose and larger context of your changes, feel free to add as much of the following information to the PR description as you can:
🔘 Get a green buildIf one or more checks are failing, continue working on your changes until this is no longer the case and your build turns green. Where can I find more information?If you'd like to get more details on all aspects of the review process for open source pull requests (OSPRs), check out the following resources: When can I expect my changes to be merged?Our goal is to get community contributions seen and reviewed as efficiently as possible. However, the amount of time that it takes to review and merge a PR can vary significantly based on factors such as:
💡 As a result it may take up to several weeks or months to complete a review and merge your PR. |
…MySQL migration This commit fixes the issue where posts from retired users cause the discussions MFE to crash with 'Missing :learnerUsername param' error after migrating from MongoDB to MySQL. Root Cause: - V1 forum (MongoDB) stores author_username and retired_username as separate fields to preserve historical usernames - V2 migration script was not reading these fields from MongoDB - MySQL models only derived username from User table at runtime - When users are retired, their username changes, losing historical data Changes Made: 1. Added author_username and retired_username fields to Content model 2. Added save() hook to set author_username on content creation 3. Updated to_dict() methods to use stored username with fallbacks 4. Updated migration script to preserve MongoDB username fields 5. Created Django migration to add database columns Testing: - Posts from active users work as before - Posts from retired users now display with correct historical username - Frontend properly handles retired user indicators - Re-running migration preserves original usernames Fixes: openedx/frontend-app-discussions#817 Related: openedx#236
…MySQL migration This commit fixes the issue where posts from retired users cause the discussions MFE to crash with 'Missing :learnerUsername param' error after migrating from MongoDB to MySQL. Root Cause: - V1 forum (MongoDB) stores author_username and retired_username as separate fields to preserve historical usernames - V2 migration script was not reading these fields from MongoDB - MySQL models only derived username from User table at runtime - When users are retired, their username changes, losing historical data Changes Made: 1. Added author_username and retired_username fields to Content model 2. Added save() hook to set author_username on content creation 3. Updated to_dict() methods to use stored username with fallbacks 4. Updated migration script to preserve MongoDB username fields 5. Created Django migration to add database columns Testing: - Posts from active users work as before - Posts from retired users now display with correct historical username - Frontend properly handles retired user indicators - Re-running migration preserves original usernames Fixes: openedx/frontend-app-discussions#817 Related: openedx#236
…MySQL migration This commit fixes the issue where posts from retired users cause the discussions MFE to crash with 'Missing :learnerUsername param' error after migrating from MongoDB to MySQL. Root Cause: - V1 forum (MongoDB) stores author_username and retired_username as separate fields to preserve historical usernames - V2 migration script was not reading these fields from MongoDB - MySQL models only derived username from User table at runtime - When users are retired, their username changes, losing historical data Changes Made: 1. Added author_username and retired_username fields to Content model 2. Added save() hook to set author_username on content creation 3. Updated to_dict() methods to use stored username with fallbacks 4. Updated migration script to preserve MongoDB username fields 5. Created Django migration to add database columns Testing: - Posts from active users work as before - Posts from retired users now display with correct historical username - Frontend properly handles retired user indicators - Re-running migration preserves original usernames Fixes: openedx/frontend-app-discussions#817 Related: openedx#236
…MySQL migration (#240) This commit fixes the issue where posts from retired users cause the discussions MFE to crash with 'Missing :learnerUsername param' error after migrating from MongoDB to MySQL. Root Cause: - V1 forum (MongoDB) stores author_username and retired_username as separate fields to preserve historical usernames - V2 migration script was not reading these fields from MongoDB - MySQL models only derived username from User table at runtime - When users are retired, their username changes, losing historical data Changes Made: 1. Added author_username and retired_username fields to Content model 2. Added save() hook to set author_username on content creation 3. Updated to_dict() methods to use stored username with fallbacks 4. Updated migration script to preserve MongoDB username fields 5. Created Django migration to add database columns Testing: - Posts from active users work as before - Posts from retired users now display with correct historical username - Frontend properly handles retired user indicators - Re-running migration preserves original usernames Fixes: openedx/frontend-app-discussions#817 Related: #236
|
@openedx/wg-maintainers-forums would someone be able to review this for us? @taimoor-ahmed-1 in the meantime, there's some branch conflicts that have popped up - would you mind resolving? |
|
@mphilbrick211 closing this PR in favor of #240 |
This PR fixes the Content Serializer class not being able to fetch username of a retired author by adding a author_username property to the Content MySQL model.
close: openedx/frontend-app-discussions#817