mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2025-01-30 10:58:09 +00:00
Fixes name import in openlibrary
This commit is contained in:
parent
a176c6cd35
commit
5cf9e24ae5
1 changed files with 1 additions and 5 deletions
|
@ -65,6 +65,7 @@ class Connector(AbstractConnector):
|
||||||
]
|
]
|
||||||
|
|
||||||
self.author_mappings = [
|
self.author_mappings = [
|
||||||
|
Mapping('name'),
|
||||||
Mapping('born', remote_field='birth_date', formatter=get_date),
|
Mapping('born', remote_field='birth_date', formatter=get_date),
|
||||||
Mapping('died', remote_field='death_date', formatter=get_date),
|
Mapping('died', remote_field='death_date', formatter=get_date),
|
||||||
Mapping('bio', formatter=get_description),
|
Mapping('bio', formatter=get_description),
|
||||||
|
@ -185,11 +186,6 @@ class Connector(AbstractConnector):
|
||||||
|
|
||||||
author = models.Author(openlibrary_key=olkey)
|
author = models.Author(openlibrary_key=olkey)
|
||||||
author = update_from_mappings(author, data, self.author_mappings)
|
author = update_from_mappings(author, data, self.author_mappings)
|
||||||
name = data.get('name')
|
|
||||||
# TODO this is making some BOLD assumption
|
|
||||||
if name:
|
|
||||||
author.last_name = name.split(' ')[-1]
|
|
||||||
author.first_name = ' '.join(name.split(' ')[:-1])
|
|
||||||
author.save()
|
author.save()
|
||||||
|
|
||||||
return author
|
return author
|
||||||
|
|
Loading…
Reference in a new issue