Repository navigation
Add last_login, password_created and verified_phone_number to User - #768
Open
annastudios wants to merge 1 commit into
Open
annastudios wants to merge 1 commit into
annastudios wants to merge 1 commit into
Conversation
GET /account/users/{username} returns these read-only fields, but User did not declare them, so Base._populate dropped them and they were only reachable through _raw_json. last_login is exposed as a UserLastLogin JSONObject (login_datetime, status) and is None until the user first logs in; password_created is parsed as a datetime.
annastudios
requested review from
josephcardillo-akamai and
mawilk90
and removed request for
a team
December 4, 2026 12:00
This branch has not been deployed
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.
📝 Description
What does this PR do and why is this change necessary?
Get a user (
GET /account/users/{username}) returns three read-only fields thatUserdoesn't declare:last_login,password_createdandverified_phone_number. SinceBase._populateonly sets declared properties, the SDK drops them, and they're only reachable throughuser._raw_json.This adds them to
User.properties:last_login: a newUserLastLoginJSONObjectwithlogin_datetimeandstatus(successfulorfailed). The API returnsnulluntil the user first logs in, so it'sNonethen.password_created: parsed as adatetimewithis_datetime=True, like the other timestamps inaccount.py.verified_phone_number: a plain property, as onProfile.All three are read-only, so they are not sent back by
save().I found these by comparing the
Userproperties against the response schema in the Linode OpenAPI spec (release-20261028).✔️ How to Test
What are the steps to reproduce the issue or verify the changes?
How do I run the relevant unit/integration tests?
test_get_usernow checks the three fields against the updatedaccount_users_test-user.jsonfixture.test_user_without_login_or_passwordchecks thatnullvalues load asNone.Both fail without the change. The full unit suite passes locally:
pytest test/unitgives 584 passed.blackandisortare clean.AI-assisted.