Skip to content

Commit

Permalink
Merge pull request #439 from MJedr/fix-add-documents
Browse files Browse the repository at this point in the history
add fulltext property to documents if it is false
  • Loading branch information
MJedr authored Nov 2, 2022
2 parents 779702c + 461e5ff commit e9d64cb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion inspire_schemas/builders/literature.py
Original file line number Diff line number Diff line change
Expand Up @@ -933,7 +933,7 @@ def add_document(self, key, url, **kwargs):
'url',
'filename',
):
if kwargs.get(dict_key):
if kwargs.get(dict_key) is not None:
document[dict_key] = kwargs[dict_key]

if key_already_there(document, self.record.get('documents', ())):
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/test_literature_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ def test_add_document():
builder.add_document(
'key',
description='description',
fulltext=True,
fulltext=False,
hidden=True,
material='preprint',
original_url='http://www.example.com/original_url',
Expand All @@ -267,7 +267,7 @@ def test_add_document():
expected = [
{
'description': 'description',
'fulltext': True,
'fulltext': False,
'hidden': True,
'key': 'key',
'material': 'preprint',
Expand Down

0 comments on commit e9d64cb

Please sign in to comment.