Common: Simplify _serialize_credentials()

This commit is contained in:
Mike Salvatore 2022-07-18 08:13:09 -04:00
parent 575fff0cdb
commit 9e7963afc0
1 changed files with 4 additions and 6 deletions

View File

@ -92,12 +92,10 @@ class CredentialsSchema(Schema):
@pre_dump
def _serialize_credentials(self, credentials: Credentials, **kwargs) -> CredentialsMapping:
data = {}
data["identity"] = CredentialsSchema._serialize_credential_component(credentials.identity)
data["secret"] = CredentialsSchema._serialize_credential_component(credentials.secret)
return data
return {
"identity": CredentialsSchema._serialize_credential_component(credentials.identity),
"secret": CredentialsSchema._serialize_credential_component(credentials.secret),
}
@staticmethod
def _serialize_credential_component(