Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions app/dynamic_func.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ def formatter(data, un_distinguishing_sign, scope, format):
)

# Normalize list and type fields
normalize_list_and_type_fields(data, attributes_req, attributes_req2)
normalize_list_and_type_fields(data, attributes_req, attributes_req2, requested_credential.get("scope"))

# Populate pdata
populate_pdata(
Expand Down Expand Up @@ -248,18 +248,20 @@ def update_dates_and_special_claims(
data["credential_type"] = doctype_config["credential_type"]


def normalize_list_and_type_fields(data, attributes_req, attributes_req2):
def normalize_list_and_type_fields(data, attributes_req, attributes_req2, scope=None):
list_fields = [
"places_of_work",
"legislation",
"employment_details",
"competent_institution",
"credential_holder",
"subject",
"residence_address",
"address"
"residence_address"
]

if scope == "eu.europa.ec.eudi.pid_vc_sd_jwt":
list_fields.append("address")

for field in list_fields:
if field in attributes_req and field in data:
if isinstance(data[field], str):
Expand All @@ -285,7 +287,6 @@ def normalize_list_and_type_fields(data, attributes_req, attributes_req2):
):
data["gender"] = int(data["gender"])


def populate_pdata(
data,
pdata,
Expand Down
Loading