Skip to content

Commit db72faf

Browse files
committed
hasattr changes
1 parent 436b09d commit db72faf

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

fabric_cf/actor/core/proxies/kafka/translate.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ def translate_slice_to_avro(*, slice_obj: ABCSlice) -> SliceAvro:
104104
avro_slice.config_properties = slice_obj.get_config_properties()
105105
avro_slice.set_lease_end(lease_end=slice_obj.get_lease_end())
106106
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'):
108108
avro_slice.set_project_id(project_id=slice_obj.get_project_id())
109109

110110
if slice_obj.get_resource_type() is not None:
@@ -124,7 +124,7 @@ def translate_auth_to_avro(*, auth: AuthToken) -> AuthAvro:
124124
result.guid = str(auth.get_guid())
125125
result.oidc_sub_claim = auth.get_oidc_sub_claim()
126126
result.email = auth.get_email()
127-
if hasattr(auth, 'token') is not None:
127+
if hasattr(auth, 'token'):
128128
result.token = auth.get_token()
129129
return result
130130

@@ -137,7 +137,8 @@ def translate_auth_from_avro(*, auth_avro: AuthAvro) -> AuthToken:
137137
result.guid = auth_avro.guid
138138
result.oidc_sub_claim = auth_avro.oidc_sub_claim
139139
result.email = auth_avro.email
140-
result.token = auth_avro.token
140+
if hasattr(auth_avro, 'token'):
141+
result.token = auth_avro.token
141142
return result
142143

143144
@staticmethod

0 commit comments

Comments
 (0)