@@ -4450,34 +4450,40 @@ async def query_da_personal_data_in_wallet(self, personal_data_id: str = None, m
4450
4450
# Iterate through personal data
4451
4451
for pd in matched_personal_data_records :
4452
4452
4453
- # Fetch data agreement template.
4454
- data_agreement_record : DataAgreementV1Record = await DataAgreementV1Record .retrieve_non_deleted_data_agreement_by_id (
4455
- self .context ,
4456
- pd .da_template_id
4457
- )
4453
+ try :
4458
4454
4459
- data_agreement_dict : DataAgreementV1 = DataAgreementV1Schema ().load (
4460
- data_agreement_record .data_agreement )
4461
-
4462
- temp_pd = {
4463
- "attribute_id" : pd .personal_data_id ,
4464
- "attribute_name" : pd .attribute_name ,
4465
- "attribute_description" : pd .attribute_description ,
4466
- "data_agreement" : {
4467
- "data_agreement_id" : data_agreement_record .data_agreement_record_id ,
4468
- "method_of_use" : data_agreement_record .method_of_use ,
4469
- "data_agreement_usage_purpose" : data_agreement_dict .usage_purpose ,
4470
- "publish_flag" : data_agreement_record .is_published
4471
- },
4472
- "created_at" : str_to_epoch (pd .created_at ),
4473
- "updated_at" : str_to_epoch (pd .updated_at ),
4474
- }
4455
+ # Fetch data agreement template.
4456
+ data_agreement_record : DataAgreementV1Record = await DataAgreementV1Record .retrieve_non_deleted_data_agreement_by_id (
4457
+ self .context ,
4458
+ pd .da_template_id
4459
+ )
4475
4460
4476
- if method_of_use :
4477
- if data_agreement_record .method_of_use == method_of_use :
4461
+ data_agreement_dict : DataAgreementV1 = DataAgreementV1Schema ().load (
4462
+ data_agreement_record .data_agreement )
4463
+
4464
+ temp_pd = {
4465
+ "attribute_id" : pd .personal_data_id ,
4466
+ "attribute_name" : pd .attribute_name ,
4467
+ "attribute_description" : pd .attribute_description ,
4468
+ "data_agreement" : {
4469
+ "data_agreement_id" : data_agreement_record .data_agreement_record_id ,
4470
+ "method_of_use" : data_agreement_record .method_of_use ,
4471
+ "data_agreement_usage_purpose" : data_agreement_dict .usage_purpose ,
4472
+ "publish_flag" : data_agreement_record .is_published
4473
+ },
4474
+ "created_at" : str_to_epoch (pd .created_at ),
4475
+ "updated_at" : str_to_epoch (pd .updated_at ),
4476
+ }
4477
+
4478
+ if method_of_use :
4479
+ if data_agreement_record .method_of_use == method_of_use :
4480
+ serialised_personal_data_records .append (temp_pd )
4481
+ else :
4478
4482
serialised_personal_data_records .append (temp_pd )
4479
- else :
4480
- serialised_personal_data_records .append (temp_pd )
4483
+
4484
+ except (StorageNotFoundError , StorageDuplicateError ) as e :
4485
+ # Continue to other personal data records.
4486
+ continue
4481
4487
4482
4488
return self .serialize_personal_data_record (
4483
4489
personal_data_records = serialised_personal_data_records ,
0 commit comments