@@ -522,12 +522,14 @@ def validate_metadata(json_record):
522522 if not isinstance (creator , dict ):
523523 errors .append ("Each 'creator' must be a dictionry" )
524524 if "nameType" in creator :
525- if creator ["nameType" ] == "Organizational"
525+ if creator ["nameType" ] == "Organizational" :
526526 if "name" not in creator :
527527 errors .append ("Each organizational 'creator' must have 'name'." )
528- else
528+ else :
529529 if "familyName" not in creator :
530- errors .append ("Each 'creator' must have a " familyName " or have type Organizational" )
530+ errors .append (
531+ "Each 'creator' must have a 'familyName' or have type Organizational"
532+ )
531533 if "affiliation" in creator :
532534 if not isinstance (creator ["affiliation" ], list ):
533535 errors .append ("'affiliation' in 'creators' should be a list." )
@@ -542,28 +544,37 @@ def validate_metadata(json_record):
542544 if (
543545 not isinstance (json_record ["contributors" ], list )
544546 or len (json_record ["contributors" ]) == 0
545- ):
547+ ):
546548 errors .append ("'creators' should be a non-empty list." )
547549 else :
548550 for contributor in json_record ["contributors" ]:
549551 if not isinstance (contributor , dict ):
550552 errors .append ("Each 'contributor' must be a dictionry" )
551553 if "nameType" in contributor :
552- if contributor ["nameType" ] == "Organizational"
554+ if contributor ["nameType" ] == "Organizational" :
553555 if "name" not in creator :
554- errors .append ("Each organizational 'contributor' must have 'name'." )
555- else
556+ errors .append (
557+ "Each organizational 'contributor' must have 'name'."
558+ )
559+ else :
556560 if "familyName" not in contributor :
557- errors .append ("Each 'contributor' must have a " familyName " or have type Organizational" )
561+ errors .append (
562+ "Each 'contributor' must have a 'familyName' or have type Organizational"
563+ )
558564 if "affiliation" in contributor :
559565 if not isinstance (contributor ["affiliation" ], list ):
560- errors .append ("'affiliation' in 'contributors' should be a list." )
566+ errors .append (
567+ "'affiliation' in 'contributors' should be a list."
568+ )
561569 for affiliation in contributor ["affiliation" ]:
562- if not isinstance (affiliation , dict ) or "name" not in affiliation :
570+ if (
571+ not isinstance (affiliation , dict )
572+ or "name" not in affiliation
573+ ):
563574 errors .append (
564575 "Each 'affiliation' in 'contributors' must have a 'name'."
565576 )
566-
577+
567578 # Check for 'geoLocations'
568579 if "geoLocations" in json_record :
569580 if not isinstance (json_record ["geoLocations" ], list ):
0 commit comments