Skip to content

Commit 9bb732d

Browse files
Update customize_schema.py
1 parent 43b7d37 commit 9bb732d

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

caltechdata_api/customize_schema.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -505,14 +505,9 @@ def validate_metadata(json_record):
505505
if not isinstance(creator, dict):
506506
errors.append("Each 'creator' must be a dictionry")
507507
if "nameType" in creator:
508-
if creator["nameType"] == "Organizational":
509-
if "name" not in creator:
510-
errors.append("Each organizational 'creator' must have 'name'.")
511-
else:
508+
if creator["nameType"] != "Organizational":
512509
if "familyName" not in creator:
513-
errors.append(
514-
"Each 'creator' must have a 'familyName' or have type Organizational"
515-
)
510+
errors.append("Each 'creator' must have a 'familyName' or have type 'Organizational'.")
516511
if "affiliation" in creator:
517512
if not isinstance(creator["affiliation"], list):
518513
errors.append("'affiliation' in 'creators' should be a list.")

0 commit comments

Comments
 (0)