Merge pull request #730 from Gluejar/protect-long-descriptions
protect long descriptionspull/46/head
commit
82d7bf20b6
|
@ -908,11 +908,16 @@ class BasePandataLoader(object):
|
||||||
)
|
)
|
||||||
if metadata.publisher: #always believe yaml
|
if metadata.publisher: #always believe yaml
|
||||||
edition.set_publisher(metadata.publisher)
|
edition.set_publisher(metadata.publisher)
|
||||||
|
|
||||||
if metadata.publication_date: #always believe yaml
|
if metadata.publication_date: #always believe yaml
|
||||||
edition.publication_date = metadata.publication_date
|
edition.publication_date = metadata.publication_date
|
||||||
|
|
||||||
|
#be careful about overwriting the work description
|
||||||
if metadata.description and len(metadata.description) > len(work.description):
|
if metadata.description and len(metadata.description) > len(work.description):
|
||||||
#be careful about overwriting the work description
|
# don't over-write reasonably long descriptions
|
||||||
work.description = metadata.description
|
if len(work.description) < 500:
|
||||||
|
work.description = metadata.description
|
||||||
|
|
||||||
if metadata.creator and not edition.authors.count():
|
if metadata.creator and not edition.authors.count():
|
||||||
edition.authors.clear()
|
edition.authors.clear()
|
||||||
for key in metadata.creator.keys():
|
for key in metadata.creator.keys():
|
||||||
|
|
Loading…
Reference in New Issue