When you want to update a user based on their idnumber, i found that looking them up by their ID AND get_complete_user_data by ID (instead of by username) and then updating their username works, rather than looking them up by ID but then getting their complete data by username.
When you want to update a user based on their idnumber, i found that looking them up by their ID AND get_complete_user_data by ID (instead of by username) and then updating their username works, rather than looking them up by ID but then getting their complete data by username.