diff --git a/swh/storage/postgresql/converters.py b/swh/storage/postgresql/converters.py --- a/swh/storage/postgresql/converters.py +++ b/swh/storage/postgresql/converters.py @@ -74,6 +74,11 @@ """ if fullname is None: return None + + if name is None and email is None: + # The fullname hasn't been parsed, try that again + return Person.from_fullname(fullname) + return Person(fullname=fullname, name=name, email=email,) diff --git a/swh/storage/tests/test_postgresql_converters.py b/swh/storage/tests/test_postgresql_converters.py --- a/swh/storage/tests/test_postgresql_converters.py +++ b/swh/storage/tests/test_postgresql_converters.py @@ -191,6 +191,11 @@ assert actual_author is None +def test_db_to_author_unparsed(): + author = converters.db_to_author(b"Fullname ", None, None) + assert author == Person.from_fullname(b"Fullname ") + + def test_db_to_revision(): # when actual_revision = converters.db_to_revision(