Skip to content

Commit

Permalink
Corrige contrib_name (#775)
Browse files Browse the repository at this point in the history
* fix Contrib.contrib_name

* Fix ArticleContribTest.test_data
  • Loading branch information
samuelveigarangel authored Dec 16, 2024
1 parent ccf0e19 commit 1d56277
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packtools/sps/models/article_contribs.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def contrib_ids(self):
def contrib_name(self):
name = self.node.find("name")
if name is not None:
return {item.tag: item.text for item in name}
return {item.tag: item.text for item in name if item.text}

@property
def contrib_full_name(self):
Expand Down
2 changes: 1 addition & 1 deletion tests/sps/models/test_article_contribs.py
Original file line number Diff line number Diff line change
Expand Up @@ -754,6 +754,7 @@ def test_data(self):
{
'city': None,
'country_name': None,
'country_code': None,
'email': None,
'id': 'aff4',
'label': 'a',
Expand All @@ -769,7 +770,6 @@ def test_data(self):
}
]
}

]

for i, item in enumerate(expected):
Expand Down

0 comments on commit 1d56277

Please sign in to comment.