MCPcopy Create free account
hub / github.com/fastapi-users/fastapi-users / update_oauth_account

Method update_oauth_account

tests/conftest.py:430–447  ·  view source on GitHub ↗
(  # type: ignore
            self,
            user: UserOAuthModel,
            oauth_account: OAuthAccountModel,
            update_dict: dict[str, Any],
        )

Source from the content-addressed store, hash-verified

428 return user
429
430 async def update_oauth_account( # type: ignore
431 self,
432 user: UserOAuthModel,
433 oauth_account: OAuthAccountModel,
434 update_dict: dict[str, Any],
435 ) -> UserOAuthModel:
436 for field, value in update_dict.items():
437 setattr(oauth_account, field, value)
438 updated_oauth_accounts = []
439 for existing_oauth_account in user.oauth_accounts:
440 if (
441 existing_oauth_account.account_id == oauth_account.account_id
442 and existing_oauth_account.oauth_name == oauth_account.oauth_name
443 ):
444 updated_oauth_accounts.append(oauth_account)
445 else:
446 updated_oauth_accounts.append(existing_oauth_account)
447 return user
448
449 return MockUserDatabase()
450

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected