Skip to content

Commit

Permalink
OA: stop if 540 field is not present
Browse files Browse the repository at this point in the history
  • Loading branch information
ErnestaP committed Apr 23, 2024
1 parent 968ff26 commit 91013ed
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions dags/open_access/parsers.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ def get_golden_access_records_ids(data):
golden_access = []
for record in records:
datafields = record.find("datafield/[@tag='540']")
if datafields is None:
continue
record_type = datafields.find("subfield/[@code='3']")
license = datafields.find("subfield/[@code='a']")
if record_type is not None and license is not None:
Expand Down

0 comments on commit 91013ed

Please sign in to comment.