Skip to content

Commit

Permalink
parsers.nlm: allow lack of publication date
Browse files Browse the repository at this point in the history
Signed-off-by: Szymon Łopaciuk <[email protected]>
  • Loading branch information
szymonlopaciuk committed Jan 17, 2018
1 parent 8cdf47a commit d745f78
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions hepcrawl/parsers/nlm.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@ def parse(self):
self.builder.add_doi(**doi)
for keyword in self.keywords:
self.builder.add_keyword(keyword)
self.builder.add_imprint_date(self.print_publication_date.dumps())
if self.print_publication_date:
self.builder.add_imprint_date(self.print_publication_date.dumps())

return self.builder.record

Expand Down Expand Up @@ -174,7 +175,7 @@ def publication_info(self):
'material': self.material,
'page_start': self.page_start,
'page_end': self.page_end,
'year': pub_date.year,
'year': pub_date.year if pub_date else None,
}

return publication_info
Expand Down

0 comments on commit d745f78

Please sign in to comment.