@@ -104,7 +104,7 @@ def translate_slice_to_avro(*, slice_obj: ABCSlice) -> SliceAvro:
104
104
avro_slice .config_properties = slice_obj .get_config_properties ()
105
105
avro_slice .set_lease_end (lease_end = slice_obj .get_lease_end ())
106
106
avro_slice .set_lease_start (lease_start = slice_obj .get_lease_start ())
107
- if hasattr (slice_obj , 'project_id' ) is not None :
107
+ if hasattr (slice_obj , 'project_id' ):
108
108
avro_slice .set_project_id (project_id = slice_obj .get_project_id ())
109
109
110
110
if slice_obj .get_resource_type () is not None :
@@ -124,7 +124,7 @@ def translate_auth_to_avro(*, auth: AuthToken) -> AuthAvro:
124
124
result .guid = str (auth .get_guid ())
125
125
result .oidc_sub_claim = auth .get_oidc_sub_claim ()
126
126
result .email = auth .get_email ()
127
- if hasattr (auth , 'token' ) is not None :
127
+ if hasattr (auth , 'token' ):
128
128
result .token = auth .get_token ()
129
129
return result
130
130
@@ -137,7 +137,8 @@ def translate_auth_from_avro(*, auth_avro: AuthAvro) -> AuthToken:
137
137
result .guid = auth_avro .guid
138
138
result .oidc_sub_claim = auth_avro .oidc_sub_claim
139
139
result .email = auth_avro .email
140
- result .token = auth_avro .token
140
+ if hasattr (auth_avro , 'token' ):
141
+ result .token = auth_avro .token
141
142
return result
142
143
143
144
@staticmethod
0 commit comments