less agressive merging in doab

pull/91/head
eric 2018-06-18 17:04:40 -04:00
parent 53a0791da0
commit 2f9dda8432
1 changed files with 5 additions and 4 deletions

View File

@ -142,10 +142,11 @@ def add_all_isbns(isbns, work, language=None, title=None):
if edition:
first_edition = first_edition if first_edition else edition
if work and (edition.work_id != work.id):
if work.created < edition.work.created:
work = merge_works(work, edition.work)
else:
work = merge_works(edition.work, work)
if work.doab and edition.work.doab and work.doab != edition.work.doab:
if work.created < edition.work.created:
work = merge_works(work, edition.work)
else:
work = merge_works(edition.work, work)
else:
work = edition.work
return work, first_edition