Fix: rename 'username' to 'name' in account creation endpoints (api side, web#955)#511
Open
mircealungu wants to merge 1 commit intomasterfrom
Open
Fix: rename 'username' to 'name' in account creation endpoints (api side, web#955)#511mircealungu wants to merge 1 commit intomasterfrom
mircealungu wants to merge 1 commit intomasterfrom
Conversation
The HTTP form parameter for the user's display name was inconsistently
called 'username' in the add_user / add_basic_user endpoints and the
create_account / create_basic_account functions, while the User model,
DB column, settings endpoint, and API response all use 'name'.
Rename the form parameter and internal variable throughout:
- accounts.py: request.form.get("username") → request.form.get("name")
- user_account_creation.py: parameter 'username' → 'name' in both
create_account() and create_basic_account()
- test_account_creation.py: update form data keys to match
Must be applied together with the matching web/accounts.js change.
Closes zeeguu/web#955
|
ArchLens - No architecturally relevant changes to the existing views |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes the API-side of the naming inconsistency described in zeeguu/web#955.
The
add_userandadd_basic_userendpoints were reading the user's display name from theusernameform field, and passing it throughcreate_account()/create_basic_account()as a parameter also namedusername. This was inconsistent with:User.__init__andUser.name(the model usesname)namedatabase columnuser_settingsendpoint which readsdata.get("name", None)get_user_detailsAPI response which returnsnameChanges:
accounts.py:request.form.get("username")→request.form.get("name")in bothadd_userandadd_basic_useruser_account_creation.py: parameterusername→nameincreate_account()andcreate_basic_account()test_account_creation.py: update form data keys fromusername=toname=Must be merged together with the matching web-side PR: zeeguu/web#996
Commits
5263cf4): Rename the form parameter and internal variable fromusernametonamethroughout the account creation flow, including tests.